1 | # $Id$ |
---|
2 | |
---|
3 | PyKota - Print Quotas for CUPS and LPRng |
---|
4 | |
---|
5 | (c) 2003-2004 Jerome Alet <alet@librelogiciel.com> |
---|
6 | This program is free software; you can redistribute it and/or modify |
---|
7 | it under the terms of the GNU General Public License as published by |
---|
8 | the Free Software Foundation; either version 2 of the License, or |
---|
9 | (at your option) any later version. |
---|
10 | |
---|
11 | This program is distributed in the hope that it will be useful, |
---|
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | GNU General Public License for more details. |
---|
15 | |
---|
16 | You should have received a copy of the GNU General Public License |
---|
17 | along with this program; if not, write to the Free Software |
---|
18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
19 | |
---|
20 | ==================================================================== |
---|
21 | |
---|
22 | READ SPECIAL LICENSING AND REDISTRIBUTION TERMS IN THE FILE 'LICENSE' |
---|
23 | |
---|
24 | ==================================================================== |
---|
25 | |
---|
26 | PyKota features : |
---|
27 | ----------------- |
---|
28 | |
---|
29 | Free Software : |
---|
30 | |
---|
31 | - Licensed under the terms of the GNU General Public License. |
---|
32 | |
---|
33 | Commercially Supported : |
---|
34 | |
---|
35 | - Support Contracts are available from http://www.librelogiciel.com/techsupport/ |
---|
36 | |
---|
37 | Operating systems : |
---|
38 | |
---|
39 | - Any Unix-like system as print server. |
---|
40 | |
---|
41 | - Any operating system as client. |
---|
42 | |
---|
43 | Printing systems : |
---|
44 | |
---|
45 | - Supports both CUPS and LPRng as the printing system. |
---|
46 | NB : LPRng is only supported with versions |
---|
47 | of PyKota <= v1.22HotFix1, but support for LPRng |
---|
48 | may be reintroduced at a later date. |
---|
49 | This version DOES NOT support LPRng ! |
---|
50 | |
---|
51 | Databases : |
---|
52 | |
---|
53 | - Supports PostgreSQL as the database backend. |
---|
54 | An SQL script to create the database is included. |
---|
55 | |
---|
56 | - Supports any LDAP server as the database backend. |
---|
57 | Complete LDAP schema and sample empty tree are included. |
---|
58 | Plugging PyKota into your existing LDAP infrastructure |
---|
59 | is really easy thanks to PyKota's great configurability. |
---|
60 | |
---|
61 | - Supports SQLite as the database backend. |
---|
62 | An SQL script to create the database is included. |
---|
63 | |
---|
64 | - The print jobs history can be stored in any database |
---|
65 | of your choice (or in plain text files) if needed. |
---|
66 | |
---|
67 | - Master and slave databases are supported : master |
---|
68 | in read+write mode, slave in readonly mode. |
---|
69 | Master and slave databases can be of different types ! |
---|
70 | |
---|
71 | Printers : |
---|
72 | |
---|
73 | - Hardware or Software accounting methods are completely |
---|
74 | configurable. |
---|
75 | |
---|
76 | - Supports any printer which can report its internal |
---|
77 | page counter. Can ask printers for their internal |
---|
78 | page counter via SNMP, Netatalk, PJL, PS, or any |
---|
79 | other way. |
---|
80 | This is completely configurable. |
---|
81 | |
---|
82 | - Supports DSC compliant and binary PostScript, PDF, PCL5 (up to), |
---|
83 | PCLXL (aka PCL6), ESC/P2, DVI, TIFF, OpenOffice.org Writer and |
---|
84 | OpenOffice.org Impress printers (or virtual printers) natively |
---|
85 | (through the direct use of pkpgcounter's code) for software |
---|
86 | accounting methods. More formats to come. |
---|
87 | |
---|
88 | - Supports any other Page Description Language for which you |
---|
89 | have a parser which can be scripted. |
---|
90 | |
---|
91 | Quota systems : |
---|
92 | |
---|
93 | - Supports printers and printers groups quotas. |
---|
94 | |
---|
95 | - Supports users and users groups quotas. |
---|
96 | |
---|
97 | - Supports page quotas. |
---|
98 | Page quotas can be set differently on a per printer |
---|
99 | and per user/group basis. |
---|
100 | |
---|
101 | - Supports account balance quotas in any currency. |
---|
102 | Account balance quotas can be set on a per user |
---|
103 | basis. The account balance is shared amongst |
---|
104 | all printers. The history of payments (positive |
---|
105 | or negative credits to an user account) is kept. |
---|
106 | |
---|
107 | - Supports high granularity periodic print quotas : down |
---|
108 | to one minute intervals if needed. |
---|
109 | |
---|
110 | - Page quotas and account balance can be set/reset |
---|
111 | independantly. |
---|
112 | |
---|
113 | - Page quotas can be set on a per user or per group basis |
---|
114 | for a particular printer. |
---|
115 | |
---|
116 | - Price per page and per job can be set differently |
---|
117 | on any printer. |
---|
118 | |
---|
119 | - Low level of page quota or account balance are |
---|
120 | configurable. |
---|
121 | |
---|
122 | - Both soft and hard limit with configurable grace delay |
---|
123 | can be set for page quota. |
---|
124 | |
---|
125 | - Both soft and hard limits can be increased or decreased at will. |
---|
126 | |
---|
127 | - Possibility to disable quota enforcement for any user |
---|
128 | or group, while still keeping page accounting. |
---|
129 | |
---|
130 | - Each user can have an overcharging (or undercharging) factor, |
---|
131 | which is applied whenever PyKota computes the cost of a |
---|
132 | print job. |
---|
133 | |
---|
134 | - Specific pages and credits counters can be defined per billing code, |
---|
135 | and can be reset independantly of the printing history. |
---|
136 | |
---|
137 | - Supports a passthrough mode for printers, which doesn't modify |
---|
138 | users quota when they print. |
---|
139 | |
---|
140 | - Supports a maximum number of pages per job, configurable for each |
---|
141 | printer. |
---|
142 | |
---|
143 | - Each user can be completely forbidden to print, independantly from |
---|
144 | other users. |
---|
145 | |
---|
146 | - A transparent printing mode is supported for users, in which |
---|
147 | their quota is not modified when they print. |
---|
148 | |
---|
149 | Administration : |
---|
150 | |
---|
151 | - Almost turn-key solution, with the help of the pkturnkey command |
---|
152 | line tool for database initialization and initial configuration. |
---|
153 | |
---|
154 | - Powerful delegation of administrative priviledges. |
---|
155 | |
---|
156 | - Powerful administration tools can be used to |
---|
157 | automate setting or resetting of quotas or |
---|
158 | account balances at specific intervals. |
---|
159 | |
---|
160 | - Administration tools can modify several users, |
---|
161 | groups, or printers at once with the use of |
---|
162 | powerful wildcard characters. |
---|
163 | |
---|
164 | - Account balances can be set, incremented, or |
---|
165 | decremented. History of payments is kept. |
---|
166 | |
---|
167 | - Number of pages used can be set, incremented, or |
---|
168 | decremented. |
---|
169 | |
---|
170 | - Both printers and users can be automatically added on |
---|
171 | first print in a completely configurable way. |
---|
172 | |
---|
173 | - Quota report generator available either from the |
---|
174 | command line or in any web browser. |
---|
175 | The web-based quota report generator can be |
---|
176 | user/password protected. |
---|
177 | |
---|
178 | - Print quote generator can tell users how much |
---|
179 | a print job will cost them in advance. |
---|
180 | |
---|
181 | - Policy with regard to unregistered users can |
---|
182 | be configured for each printer to either deny |
---|
183 | printing, allow printing, or delegate the |
---|
184 | decision to any external tool. |
---|
185 | |
---|
186 | - Warning and error messages can be automatically |
---|
187 | sent via email or via any other mean to the administrator, |
---|
188 | the user, both, or none. |
---|
189 | |
---|
190 | - Warning and error messages' content is completely |
---|
191 | configurable. |
---|
192 | |
---|
193 | - Configuration can be changed without needing to |
---|
194 | restart the printing system. |
---|
195 | |
---|
196 | - Complete print job history is kept. This can be |
---|
197 | disabled if needed. |
---|
198 | |
---|
199 | - Automated low quota or balance remainder can be |
---|
200 | scheduled regularly or launched manually. |
---|
201 | |
---|
202 | - Starting and Ending personalized dynamic banners can be |
---|
203 | generated on the fly, and accounted for or not, depending |
---|
204 | on some configuration settings. |
---|
205 | Banners can still be enabled even if the print job is denied. |
---|
206 | NB : Banners are a CUPS only feature for now. |
---|
207 | |
---|
208 | - Duplicate print jobs can be forbidden automatically. The decision |
---|
209 | can be left to any script to decide this on a per job basis. |
---|
210 | |
---|
211 | - Username and billing code can be overwritten at printing time, |
---|
212 | to allow people to login as guest users and print as authenticated |
---|
213 | users, for example. |
---|
214 | |
---|
215 | - Powerful data dumper to export datas to other |
---|
216 | software (spreadsheets for example). Actually |
---|
217 | supported formats are : |
---|
218 | |
---|
219 | - Comma separated values ; |
---|
220 | |
---|
221 | - Semicolon separated values ; |
---|
222 | |
---|
223 | - Tab separated values ; |
---|
224 | |
---|
225 | - XML. |
---|
226 | |
---|
227 | - CUPS' page_log format, to easily interface in |
---|
228 | real time with third party apps like phpPrintAnalyzer |
---|
229 | and similar tools. |
---|
230 | |
---|
231 | User Interface : |
---|
232 | |
---|
233 | - All the command line tools accept the -h | --help |
---|
234 | command line option which prints all the available |
---|
235 | options and show usage examples. |
---|
236 | |
---|
237 | - Completely internationalized. Actually supports at least partially |
---|
238 | English, French, Polish, Spanish, Portuguese, Brazilian, Swedish, |
---|
239 | Thai, Greek, German, Italian, Norwegian (Bokm�, Turkish |
---|
240 | and traditional Chinese languages. |
---|
241 | More to come. |
---|
242 | |
---|
243 | - Web enabled print quota monitor, data dumper, and quote |
---|
244 | generator. |
---|
245 | |
---|
246 | - An On Screen Display X-Window print quota monitor is included. |
---|
247 | |
---|
248 | - An email gateway to allow users to retrieve their print quota |
---|
249 | information by sending an email message to a dedicated address |
---|
250 | is included. |
---|
251 | |
---|
252 | - A cross-platform print quota monitor will soon be available |
---|
253 | as an purchaseable add-on. |
---|
254 | |
---|
255 | - Third party web based management tools are available. |
---|
256 | |
---|
257 | ==================================================================== |
---|
258 | |
---|
259 | Planned features are described in the TODO file. |
---|
260 | |
---|
261 | Actually two (or an infinity of) page accounting methods are |
---|
262 | implemented : |
---|
263 | |
---|
264 | - The 'hardware' method consists in querying the printer (via SNMP |
---|
265 | or Netatalk or any other method of your choice) for its total pages |
---|
266 | counter. |
---|
267 | This is done both at the beginning and at the end of a |
---|
268 | print job. The counters difference is then immediately used to |
---|
269 | decrease the user's account balance or increase his quota usage. |
---|
270 | |
---|
271 | - The 'software' method consists in delegating the computation of the |
---|
272 | job's size in number of pages to any external command of your choice. |
---|
273 | The command can read the job's data from its standard input and MUST |
---|
274 | output the job's size on its standard output. Changes to the user |
---|
275 | account are reported immediately. |
---|
276 | |
---|
277 | PyKota featured an internal software accounting method which handles |
---|
278 | several Page Description Languages : DSC compliant and binary PostScript, |
---|
279 | PDF, PCLXL (aka PCL6), PCL3/4/5, ESC/P2, DVI, TIFF, OpenOffice.org Writer |
---|
280 | and OpenOffice.org Impress. This software is now distributed separately |
---|
281 | as 'pkpgcounter', and not included anymore in PyKota, so you must now |
---|
282 | download and install it before running PyKota. |
---|
283 | |
---|
284 | PyKota is known to work fine with most laser printers, either with |
---|
285 | software accounting, or with hardware accounting if the printer |
---|
286 | supports this. |
---|
287 | |
---|
288 | ============================================================ |
---|
289 | |
---|
290 | SUPPORT CONTRACTS: |
---|
291 | ================== |
---|
292 | |
---|
293 | You can now purchase 8x5x365@NextBusinessDay Technical |
---|
294 | Support Contracts from us. The yearly fee is computed with |
---|
295 | the following formula : |
---|
296 | |
---|
297 | (100.0 * NbPrintServers) + (2.5 * NbPrinters) + (0.04 * NbUsers) EUROS. |
---|
298 | |
---|
299 | This fee includes the VAT, and a free subscription to Official |
---|
300 | PyKota packages. |
---|
301 | |
---|
302 | Please send an email to alet@librelogiciel.com if you're |
---|
303 | interested in purchasing such a contract. |
---|
304 | |
---|
305 | Remember that purchasing a support contract for Free Software like PyKota |
---|
306 | is a great way to show your appreciation for the work already being done |
---|
307 | on this project, and will help to improve this software in the future. |
---|
308 | |
---|
309 | ============================================================ |
---|
310 | |
---|
311 | INSTALLATION: |
---|
312 | ============= |
---|
313 | |
---|
314 | NB : |
---|
315 | ==== |
---|
316 | |
---|
317 | PyKota's documentation is now at : |
---|
318 | |
---|
319 | http://www.librelogiciel.com/software/PyKota/WiKota/ |
---|
320 | |
---|
321 | You may learn more about PyKota, if it fits your own organization, |
---|
322 | its internal working, and some potential performance drawbacks and |
---|
323 | how to avoid them, in a document created by Ryan Suarez at : |
---|
324 | |
---|
325 | http://archive.macosxlabs.org/forum/webcrossing_archive/documentation/Pykota_and_CUPS/Pykota_and_CUPS.html |
---|
326 | |
---|
327 | You may also find the following document interesting : |
---|
328 | |
---|
329 | http://es.tldp.org/Tutoriales/doc-openldap-samba-cups-python/ |
---|
330 | |
---|
331 | This document, written in Spanish by Sergio Gonzalez Gonzalez, |
---|
332 | describes the integration of PyKota into an OpenLDAP + Samba |
---|
333 | + CUPS installation. Even for people who can't read spanish |
---|
334 | this document is really interesting, and contains lots of |
---|
335 | screenshots. |
---|
336 | |
---|
337 | Finally, SuSe users may find the following document to best describe |
---|
338 | how to install PyKota on their favorite distribution. It's a Spanish |
---|
339 | document written by Dennis Romero : |
---|
340 | |
---|
341 | http://www.cvr.espol.edu.ec/people/dennis/Pykota1.19-SuSE9.1.pdf |
---|
342 | |
---|
343 | |
---|
344 | Prerequisite : |
---|
345 | -------------- |
---|
346 | |
---|
347 | You need to have the following tools installed on the CUPS Server : |
---|
348 | |
---|
349 | - CUPS (http://www.cups.org) |
---|
350 | - Python v2.1 or above (http://www.python.org) |
---|
351 | - eGenix' mxDateTime Python extension (http://www.egenix.com) |
---|
352 | - The pkpgcounter command line tool, version 1.56 or higher. This |
---|
353 | tool is now mandatory for PyKota to work. |
---|
354 | (http://www.librelogiciel.com/software/) |
---|
355 | - The JAXML Python module to be able to dump datas in the XML format. |
---|
356 | (http://www.librelogiciel.com/software/) |
---|
357 | - The Python-SNMP module to query printers for their page counter. |
---|
358 | (http://pysnmp.sourceforge.net). |
---|
359 | IMPORTANT : version 3.4.4 (or 3.4.3 or 3.4.2) is REQUIRED. |
---|
360 | Versions 2.x or 4.x won't work for now. |
---|
361 | - The Python-OSD module to use the graphical print quota reminder. |
---|
362 | (http://repose.cx/pyosd/) |
---|
363 | - SNMP tools (specifically the snmpget command) if you prefer to |
---|
364 | use your own script to request query printers. |
---|
365 | (http://www.net-snmp.org) |
---|
366 | - Netatalk (specifically the pap command) if you plan to |
---|
367 | request your printer's lifetime page counter via AppleTalk. |
---|
368 | (http://netatalk.sourceforge.net) |
---|
369 | - The ReportLab Python module (http://www.reportlab.org) if you want |
---|
370 | to have PyKota generate nice banners for you. |
---|
371 | - The Python Imaging Library (aka PIL) module |
---|
372 | (http://www.pythonware.com/downloads) if you want to have PyKota |
---|
373 | generate nice banners for you. |
---|
374 | - PostgreSQL's PygreSQL Python extension and the PostgreSQL client |
---|
375 | libraries if you plan to use PostgreSQL as the database backend. |
---|
376 | (http://www.postgresql.org and http://www.pygreql.org) |
---|
377 | or |
---|
378 | - python-ldap Python module and the OpenLDAP client libraries |
---|
379 | if you plan to use an LDAP server as the database backend. |
---|
380 | (http://www.openldap.org and http://python-ldap.sourceforge.net) |
---|
381 | or |
---|
382 | - SQLite v3.2.7 and the SQLite libraries if you plan to use SQLite |
---|
383 | as the database backend (http://www.sqlite.org). You also need the |
---|
384 | PySQLite module v2.0.5 or higher (http://www.pysqlite.org) |
---|
385 | |
---|
386 | |
---|
387 | On Intel i386 architecture, and for performance reasons, it is |
---|
388 | strongly suggested that you install the Python accelerator Psyco, |
---|
389 | available at : |
---|
390 | |
---|
391 | http://psyco.sourceforge.net |
---|
392 | |
---|
393 | Under Debian : |
---|
394 | |
---|
395 | $ apt-get install python-psyco |
---|
396 | |
---|
397 | Other architectures may be supported as well in the future, check |
---|
398 | this on Psyco's website. |
---|
399 | |
---|
400 | Installing Psyco is not mandatory, but it will speedup PCL5 parsing |
---|
401 | by almost 3 times. PostScript and PDF parsing can also benefit, |
---|
402 | but in an almost unnoticeable manner since this part of the code |
---|
403 | is already optimal. For PCL5 this is a completely different matter, |
---|
404 | and if you install Psyco you will never regret it ! |
---|
405 | Same remark applies for PCL6 (aka PCLXL) : the parser is completely |
---|
406 | different, but the performance gain with Psyco is impressive. |
---|
407 | |
---|
408 | You may also benefit from having the following tools installed to |
---|
409 | deal with some printers : |
---|
410 | |
---|
411 | - npadmin |
---|
412 | - netcat |
---|
413 | - ghostscript |
---|
414 | |
---|
415 | You need to have the following tools installed on the database |
---|
416 | server : |
---|
417 | |
---|
418 | - PostgreSQL (http://www.postgresql.org) |
---|
419 | |
---|
420 | or |
---|
421 | |
---|
422 | - OpenLDAP, or any other LDAP server (http://www.openldap.org) |
---|
423 | |
---|
424 | or |
---|
425 | |
---|
426 | - SQLite, v3.2.7 or higher (http://www.sqlite.org). |
---|
427 | Beware : with SQLite the database server and the print |
---|
428 | servers MUST be the very same machine. |
---|
429 | |
---|
430 | NB : |
---|
431 | |
---|
432 | PygreSQL must be linked with the PostgreSQL client libraries on |
---|
433 | the Print Server. The PostgreSQL client libraries' version must |
---|
434 | match the PostgreSQL version used on the database server. |
---|
435 | |
---|
436 | or |
---|
437 | |
---|
438 | python-ldap must be linked with the OpenLDAP client libraries on the |
---|
439 | Print Server. The OpenLDAP client libraries' version should match the |
---|
440 | OpenLDAP version used on the database server, if applicable. |
---|
441 | |
---|
442 | This list of prerequisite software may change in the future, when |
---|
443 | PyKota will support more functionnalities you will be given |
---|
444 | alternatives. |
---|
445 | |
---|
446 | Of course the Print Server and the database server can be the |
---|
447 | very same machine if you've got a tiny network, or you can have |
---|
448 | multiple Print Servers all storing their quotas on the same database |
---|
449 | server if you've got a bigger network. (NB : with SQLite, the database |
---|
450 | can't be shared between several print servers) |
---|
451 | |
---|
452 | Hint : |
---|
453 | ------ |
---|
454 | |
---|
455 | - The Debian GNU/Linux distribution is to our knowledge the |
---|
456 | easiest distribution to install PyKota on, because all |
---|
457 | of PyKota dependencies are already included, excepted |
---|
458 | for the PySNMP (http://pysnmp.sourceforge.net) module |
---|
459 | and the pkpgcounter utility which for now have to be downloaded |
---|
460 | and installed separately. |
---|
461 | |
---|
462 | Then : |
---|
463 | ------ |
---|
464 | |
---|
465 | Download the latest PyKota version from the Subversion tree : |
---|
466 | |
---|
467 | $ svn co svn://svn.librelogiciel.com/pykota/trunk pykota |
---|
468 | |
---|
469 | You can now check if the dependencies are correct by typing : |
---|
470 | |
---|
471 | $ python checkdeps.py |
---|
472 | |
---|
473 | An availability report for all the software needed by PyKota |
---|
474 | will be displayed : you'll have to install the missing |
---|
475 | software if you want PyKota to work correctly. |
---|
476 | |
---|
477 | To install the software, just type : |
---|
478 | |
---|
479 | $ python setup.py install |
---|
480 | |
---|
481 | You may need to be logged in with sufficient privileges (e.g. root) |
---|
482 | |
---|
483 | Create a system user for PyKota : |
---|
484 | |
---|
485 | $ adduser --system --group --home /etc/pykota --gecos PyKota pykota |
---|
486 | |
---|
487 | Put the user your printing system is run as in the pykota system group : |
---|
488 | |
---|
489 | $ adduser lp pykota |
---|
490 | |
---|
491 | NB : on our system, the CUPS printing system runs as system user 'lp'. |
---|
492 | Please adapt this to your own system. |
---|
493 | |
---|
494 | Go to the initscripts subdirectory of PyKota's sources, and choose |
---|
495 | the appropriate storage backend for your configuration. Read carefully |
---|
496 | the associated README file and execute the initialization script |
---|
497 | to create an empty PyKota database. Upgrade scripts may be |
---|
498 | provided as well. NB : if you use PostgreSQL, a good way to |
---|
499 | make PyKota work first time is to modify PostgreSQL's pg_hba.conf |
---|
500 | to allow the 'trust' database connection mode. However once PyKota |
---|
501 | works it is HIGHLY RECOMMENDED TO CHANGE THIS TO A MORE SECURE |
---|
502 | VALUE. |
---|
503 | |
---|
504 | Copy the conf/pykota.conf.sample and conf/pykotadmin.conf.sample |
---|
505 | sample configuration files to /etc/pykota/pykota.conf and |
---|
506 | /etc/pykota/pykotadmin.conf |
---|
507 | The installation script usually copies these files into /usr/share/pykota |
---|
508 | |
---|
509 | NB : You can move PyKota's configuration files elsewhere, they will |
---|
510 | be searched first in user pykota's home directory. |
---|
511 | |
---|
512 | You need to adapt these files to your own needs. Especially you may |
---|
513 | have to create sections named after your own printers, and change |
---|
514 | the administrator's email address which by default is |
---|
515 | root@localhost. Read and try to understand these two very well |
---|
516 | commented files, so that you'll encounter less problems later. |
---|
517 | |
---|
518 | Also be sure to double check that commands that query printers |
---|
519 | for their internal page counter work from the command line |
---|
520 | before using them in PyKota's configuration. |
---|
521 | |
---|
522 | The rest of the installation depends on your printing system : |
---|
523 | |
---|
524 | - CUPS Printing System : |
---|
525 | |
---|
526 | Once and for all : |
---|
527 | |
---|
528 | Create a symbolic link to the cupspykota backend |
---|
529 | in CUPS's backend directory : |
---|
530 | |
---|
531 | $ cd /usr/lib/cups/backend |
---|
532 | $ ln -s /usr/share/pykota/cupspykota cupspykota |
---|
533 | |
---|
534 | Restart CUPS so that the new backend can be detected. |
---|
535 | |
---|
536 | $ /etc/init.d/cupsys restart |
---|
537 | |
---|
538 | or : |
---|
539 | |
---|
540 | $ /etc/rc.d/init.d/cupsys restart |
---|
541 | |
---|
542 | or any similar command depending on your operating system. |
---|
543 | |
---|
544 | For new printers : |
---|
545 | |
---|
546 | Go to CUPS management interface (http://localhost:631) |
---|
547 | and choose the appropriate PyKota managed device depending |
---|
548 | on the type of printer you use. For example, if your |
---|
549 | printer is waiting on : |
---|
550 | |
---|
551 | socket://myprinter.example.com:9100 |
---|
552 | |
---|
553 | Then choose : |
---|
554 | |
---|
555 | cupspykota:socket://myprinter.example.com:9100 |
---|
556 | |
---|
557 | Configure your printer as usual. |
---|
558 | |
---|
559 | Now double check /etc/pykota/pykota.conf |
---|
560 | |
---|
561 | You should manually create a section named after the |
---|
562 | printer you've just added, unless you have set |
---|
563 | all options globally. |
---|
564 | |
---|
565 | The new pkturnkey command can help you with correct settings |
---|
566 | for your printers, but don't rely on it because it is still |
---|
567 | experimental work. To have pkturnkey give you some hints |
---|
568 | about what to put into pykota.conf, just use its --doconf |
---|
569 | command line switch : |
---|
570 | |
---|
571 | $ pkturnkey --doconf |
---|
572 | |
---|
573 | pkturnkey will try to tell you what is the best accounting |
---|
574 | method for each printer and will print some lines you'll |
---|
575 | just have to copy&paste in the appropriate sections in |
---|
576 | /etc/pykota/pykota.conf |
---|
577 | |
---|
578 | For more informations about what pkturnkey can do for you, |
---|
579 | see pkturnkey's manual page or use the --help command |
---|
580 | line switch : |
---|
581 | |
---|
582 | $ pkturnkey --help | less |
---|
583 | |
---|
584 | That's all. |
---|
585 | |
---|
586 | For existing printers : |
---|
587 | |
---|
588 | If you had already installed a version of PyKota earlier |
---|
589 | than 1.16alpha7, then remove the *cupsFilter lines in your |
---|
590 | PPD files for each already managed printer. Each |
---|
591 | line to remove is of the form : |
---|
592 | |
---|
593 | *cupsFilter: "application/vnd.cups-postscript 0 /usr/share/pykota/pykota" |
---|
594 | |
---|
595 | This means that each time the pstops filter will be executed, it will |
---|
596 | pass the job's data through the pykota filter which is present in |
---|
597 | /usr/share/pykota |
---|
598 | |
---|
599 | Don't touch anything else, especially any other *cupsFilter line. |
---|
600 | Then save each of these files. |
---|
601 | |
---|
602 | Then, the easiest is to directly modify the DeviceURI lines |
---|
603 | in /etc/cups/printers.conf, you just have to put |
---|
604 | 'cupspykota:' in front of what is already on these lines. |
---|
605 | For example, replace : |
---|
606 | |
---|
607 | DeviceURI socket://myprinter.example.com:9100 |
---|
608 | |
---|
609 | with : |
---|
610 | |
---|
611 | DeviceURI cupspykota:socket://myprinter.example.com:9100 |
---|
612 | |
---|
613 | or : |
---|
614 | |
---|
615 | DeviceURI cupspykota://socket://myprinter.example.com:9100 |
---|
616 | |
---|
617 | Save the file and restart CUPS. |
---|
618 | |
---|
619 | Here too, you may find it interesting to use the pkturnkey command as |
---|
620 | described above to help with manual configuration of the file |
---|
621 | /etc/pykota/pykota.conf |
---|
622 | |
---|
623 | - LPRng Printing System : |
---|
624 | |
---|
625 | IMPORTANT : This release of PyKota DOES NOT support LPRng. |
---|
626 | |
---|
627 | If you want to use PyKota with LPRng, you have to download |
---|
628 | an earlier release of PyKota, for example v1.22HotFix1. |
---|
629 | |
---|
630 | Now you can begin to populate the PyKota's database with printers, |
---|
631 | users and groups : |
---|
632 | |
---|
633 | Add printers and users to the quota system and set their quota values : |
---|
634 | |
---|
635 | You can either use pkturnkey, or do the same things manually by |
---|
636 | using the pkprinters and edpykota command line tools : |
---|
637 | |
---|
638 | $ pkprinters --help |
---|
639 | |
---|
640 | will tell you how to create, manage or delete printers and |
---|
641 | printers groups. |
---|
642 | |
---|
643 | $ pkprinters --add --charge 0.05 hp2100 |
---|
644 | |
---|
645 | would add the printer named hp2100 with a price per page |
---|
646 | of 0.05 unit. |
---|
647 | |
---|
648 | Now set quotas for users on this printer : |
---|
649 | |
---|
650 | $ edpykota --add -P hp2100 -S 40 -H 50 user1 ... userN |
---|
651 | |
---|
652 | launching edpykota without any argument or with the --help |
---|
653 | command line option will show you all the possibilities. |
---|
654 | |
---|
655 | by default, each user is limited by "quota", this means that on |
---|
656 | each printer he can have a different soft and hard limit. |
---|
657 | You may want to limit the user by his account balance value, |
---|
658 | in which case, the print quota is shared between all printers |
---|
659 | instead of being different. To do this, use the following : |
---|
660 | |
---|
661 | $ edpykota --add -P hp2100 --limitby balance --balance 10 user1 ... userN |
---|
662 | |
---|
663 | This will put 10 $ (or Euros, PyKota doesn't care) on each user's account |
---|
664 | balance, and tell PyKota to limit them by their account balance value. |
---|
665 | Whenever they print on any printer, their account balance value is |
---|
666 | decreased by an amount which depends on the particular price per page |
---|
667 | and per job that you may have defined on the printer with edpykota's |
---|
668 | --charge command line option. |
---|
669 | Soft and Hard limits are not used if "--limitby balance" is used, |
---|
670 | but you can define a "poorman"'s threshold in /etc/pykota/pykota.conf |
---|
671 | to obtain a similar result (warning message when quota is low). |
---|
672 | |
---|
673 | Restart CUPS, for example under Debian GNU/Linux systems : |
---|
674 | |
---|
675 | $ /etc/init.d/cupsys restart |
---|
676 | |
---|
677 | Your users now should be able to print but not exceed their |
---|
678 | printing quota. |
---|
679 | |
---|
680 | To see printer quota usage on printer hp2100, you can use : |
---|
681 | |
---|
682 | $ repykota --printer hp2100 |
---|
683 | |
---|
684 | or : |
---|
685 | |
---|
686 | $ repykota |
---|
687 | |
---|
688 | which will print quota usage for all users on all printers, |
---|
689 | along with totals, if you are a PyKota Administator. If you are |
---|
690 | a regular user, only your own quota report will be produced. |
---|
691 | |
---|
692 | Quota reports are also available remotely by using the CGI script |
---|
693 | printquota.cgi provided in the cgi-bin/ subdirectory. You can |
---|
694 | also use the CSS stylesheet present in the stylesheets/ subdirectory |
---|
695 | and put it at your web server's DocumentRoot, to benefit from a nicer |
---|
696 | look, especially quota violations will appear in different colors. |
---|
697 | |
---|
698 | For additionnal security concerns, please give a look at the SECURITY |
---|
699 | file which is part of this software. |
---|
700 | |
---|
701 | To diagnose a problem when something doesn't work as expected, |
---|
702 | please read the very first entry in the FAQ document. |
---|
703 | |
---|
704 | ============================================================ |
---|
705 | |
---|
706 | Additionnal tools : |
---|
707 | ------------------- |
---|
708 | |
---|
709 | Some people have developped tools around PyKota, and make |
---|
710 | them available under the GNU General Public License : |
---|
711 | |
---|
712 | - Kanakorn Horsiritham developped phpPykotaAdmin which is |
---|
713 | a web based database independant administrative GUI, |
---|
714 | written in PHP. |
---|
715 | |
---|
716 | http://opensource.psu.ac.th/~kanakorn/mambo/ |
---|
717 | |
---|
718 | He was also kind enough to write an installation guide |
---|
719 | in english for CUPS and PyKota with phpPykotaAdmin on Fedora |
---|
720 | Core 3. You'll find this document on the same website. |
---|
721 | |
---|
722 | This great software currently at version 0.3 is a wonderful |
---|
723 | basis for an administrative GUI since it only depends on |
---|
724 | PyKota commands to be present to successfully manage |
---|
725 | PyKota's database. |
---|
726 | |
---|
727 | Additionnal software will be listed here when they will be |
---|
728 | ready. |
---|
729 | |
---|
730 | ============================================================ |
---|
731 | |
---|
732 | Mailing list : |
---|
733 | -------------- |
---|
734 | |
---|
735 | A mailing list is dedicated to Pykota, you can subscribe to it |
---|
736 | or consult its archives at : |
---|
737 | |
---|
738 | http://cgi.librelogiciel.com/mailman/listinfo/pykota |
---|
739 | |
---|
740 | The mailing list is the preferred way to obtain support, because |
---|
741 | all members can help and can also benefit from the solutions |
---|
742 | proposed by other members. |
---|
743 | |
---|
744 | Posts by non-members are usually rejected. |
---|
745 | |
---|
746 | The mailing list language is english and only english. |
---|
747 | |
---|
748 | IRC : |
---|
749 | ----- |
---|
750 | |
---|
751 | You can also chat with us : |
---|
752 | |
---|
753 | /server irc.freenode.net |
---|
754 | /join #pykota |
---|
755 | |
---|
756 | Preferred language on this channel is english, but french |
---|
757 | is also accepted. Try to avoid exposing complex problems |
---|
758 | in french because english speaking people on the channel |
---|
759 | wouldn't benefit from the solutions. |
---|
760 | |
---|
761 | PyKota's main author is known as 'tamere' on IRC. |
---|
762 | |
---|
763 | ============================================================ |
---|
764 | |
---|
765 | Please e-mail bugs to the mailing list at : pykota@librelogiciel.com |
---|
766 | or to the main author at : alet@librelogiciel.com (Jerome Alet) |
---|