root / pykota / trunk / README @ 1561

Revision 1561, 16.9 kB (checked in by jalet, 20 years ago)

Modified features list

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
RevLine 
[695]1# $Id$
2
[952]3PyKota - Print Quota for CUPS and LPRng
[695]4
[1257]5(c) 2003-2004 Jerome Alet <alet@librelogiciel.com>
[873]6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2 of the License, or
9(at your option) any later version.
[695]10
[873]11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14GNU General Public License for more details.
[695]15
[873]16You should have received a copy of the GNU General Public License
17along with this program; if not, write to the Free Software
18Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
19
[761]20====================================================================
[695]21
[1491]22   NOTE FOR LPRNG USERS :
23   
24     FROM MAY 21ST 2004 ON, AND UNTIL THIS NOTE IS REMOVED
25     FROM THIS FILE, PYKOTA CAN'T BE USED ANYMORE WITH LPRNG.
26     
27     SUPPORT FOR LPRNG SHOULD BE RE-ADDED SOON WHEN A HUGE REWRITE
28     OF SOME PARTS OF PYKOTA WILL HAVE TAKEN PLACE
29
30====================================================================
31
[1052]32READ SPECIAL LICENSING AND REDISTRIBUTION TERMS IN THE FILE 'LICENSE'
[761]33
34====================================================================
35
[1154]36PyKota features :
37-----------------
[695]38
[1154]39    Operating systems :
40   
41        - Any Unix-like system as print server.
42           
43        - Any operating system as client.
44           
45    Printing systems :
46   
[1283]47        - Supports both CUPS and LPRng as the printing system.
[1561]48       
49          NB : LPRng support is currently being rewritten, so
50          LPRng is actually not supported in latest CVS versions.
[1154]51           
52    Databases :
53   
54        - Supports PostgreSQL as the Quota Storage backend.
[1283]55          Complete database creation script in SQL is included.
[1043]56       
[1154]57        - Supports OpenLDAP as the Quota Storage backend.
[1475]58          Complete LDAP schema and sample empty tree are included.
[1160]59          Plugging PyKota into your existing LDAP infrastructure
60          is really easy thanks to PyKota's great configurability.
61           
[1154]62    Printers :       
63   
[1475]64        - Hardware or Software accounting methods are completely
65          configurable.
66         
[1154]67        - Supports any printer which can report its internal
[1475]68          page counter. Can ask printers for their internal
[1561]69          page counter via SNMP, Netatalk, PJL, PS, or any
70          other way.
[1475]71          This is completely configurable.
[1154]72         
[1561]73        - Supports PostScript, PDF and PCL5 printers natively
74          for software accounting methods. More formats to come.
[1154]75           
76    Quota systems :       
77   
[1260]78        - Supports printers and printers groups quotas.
[739]79       
[1260]80        - Supports users and users groups quotas.
81       
[1154]82        - Supports page quotas.
83          Page quotas can be set differently on a per printer
84          and per user/group basis.
[739]85       
[1154]86        - Supports account balance quotas in any currency.
87          Account balance quotas can be set on a per user
88          basis. The account balance is shared amongst
[1561]89          all printers. The history of payments (positive
90          or negative credits to an user account) is kept.
[980]91         
[1154]92        - Page quota and account balance can be set/reset
93          independantly.
94         
95        - Limiting factor, page quota or account balance, 
96          can be set on a per user or per group basis.
97         
98        - Price per page and per job can be set differently 
99          on any printer.
[794]100       
[1154]101        - Low level of page quota or account balance are
102          configurable.
[739]103         
[1154]104        - Both soft and hard limit with configurable grace delay 
105          can be set for page quota.
[900]106         
[1154]107        - Possibility to disable quota enforcement for any user
108          or group, while still keeping page accounting.
109             
110    Administration :       
111   
112        - Powerful administration tools can be used to
113          automate setting or resetting of quotas or
114          account balances at specific intervals.
[925]115         
[1154]116        - Administration tools can modify several users, 
117          groups, or printers at once.
[925]118         
[1154]119        - Account balances can be set, incremented, or 
120          decremented.
[1153]121         
[1273]122        - Both printers and users can be automatically added on
123          first print in a completely configurable way.
[1154]124         
125        - Quota report generator available either from the 
126          command line or in any web browser.
127          The web-based quota report generator can be
128          user/password protected.
129         
130        - Print quote generator can tell users how much 
131          a print job will cost them in advance.
132         
133        - Policy with regard to unregistered users can   
134          be configured for each printer to either deny
135          printing, allow printing, or delegate the
136          decision to any external tool.
137         
138        - Warning and error messages can be automatically 
139          sent via email to the administrator, the user,
140          both, or none.
141         
142        - Warning and error messages' content is completely
143          configurable.
144         
145        - Configuration can be changed without needing to 
146          restart the printing system.
[739]147       
[1154]148        - Complete print job history is kept. This can be
149          disabled if needed.
150         
151        - Automated low quota or balance remainder can be
152          scheduled regularly or launched manually.
153         
[1155]154    User Interface :         
155   
[1154]156        - All the command line tools accept the -h | --help
157          command line option which prints all the available
158          options and show usage examples.
[1155]159         
160        - Completely internationalized. Actually supports the 
[1402]161          English, French, Spanish, Portuguese, Brasilian, Swedish
162          and Italian languages. More to come.
[1154]163
164====================================================================
165       
[739]166Planned features are described in the TODO file.
167
[1507]168Actually two (or an infinity of) page accounting methods are
[980]169implemented :
[695]170
[1475]171  - The 'hardware' method consists in querying the printer (via SNMP
[1181]172    or Netatalk or any other method of your choice) for its total pages
[1186]173    counter.
[980]174   
[1186]175    With CUPS, this is done both at the beginning and at the end of a
176    print job. The counters difference is then immediately used to
177    decrease the user's account balance or increase his quota usage.
178   
179    With LPRng, this is done just before the beginning of a job, and used
180    this to modify the *preceding* user's quota. So you're always late
[1402]181    of one print job, but this is generally ok.
[1186]182   
[1475]183  - The 'software' method consists in delegating the computation of the
[980]184    job's size in number of pages to any external command of your choice.
185    The command can read the job's data from its standard input and MUST
[1186]186    output the job's size on its standard output. Changes to the user
187    account are reported immediately, both with CUPS and LPRng.
[980]188   
[919]189PyKota is known to work fine with HP Laserjet 2100 and 2200, and
[980]190Apple LaserWriter 16/600 PS, both with CUPS and LPRng, under
[1402]191Debian GNU/Linux (Sarge and Sid) operating systems. It should work
192fine with most network printers.
[724]193
[695]194============================================================
195
196INSTALLATION:
197=============
198
[1186]199NB :
200====
[887]201
[1397]202  You may learn more about PyKota, if it fits your own organization,
203  its internal working, and some potential performance drawbacks and
204  how to avoid them, in a WiKi administered by Ryan Suarez at :
205 
206    http://webcrossing.macosxlabs.org/webx?14@30.QAu3a5k0c4z.7@.26bf4661
[1034]207
[714]208Prerequisite :
209--------------
210   
211  You need to have the following tools installed on the CUPS Server :
212 
[952]213    - CUPS or LPRng
[809]214    - Python v2.1 or above
[714]215    - eGenix' mxDateTime Python extension
[919]216    - SNMP tools (specifically the snmpget command) if you plan to
217      request your printer's lifetime page counter via SNMP.
218    - Netatalk (specifically the pap command) if you plan to
219      request your printer's lifetime page counter via AppleTalk.
[1043]220    - PostgreSQL's PygreSQL Python extension and the PostgreSQL client
221      libraries if you plan to use PostgreSQL as the Quota Storage
222      backend.
223 or     
224    - python-ldap Python module and the OpenLDAP client libraries 
225      if you plan to use OpenLDAP as the Quota Storage backend.
[714]226   
[1186]227  You may also benefit from having the following tools installed to
228  deal with some printers :
229 
230    - npadmin
231    - netcat
232    - ghostscript
233   
[714]234  You need to have the following tools installed on the Quota Storage 
235  Server :
236 
237    - PostgreSQL
238   
[1043]239  or 
240 
241    - OpenLDAP
242   
[1086]243NB :   
244
245  PygreSQL must be linked with the PostgreSQL client libraries on
246  the Print Server. The PostgreSQL client libraries' version must
247  match the PostgreSQL version used on the Quota Storage Server.
[1402]248  BEWARE : under Debian Sarge, as of March 15th 2004, there's a
249  problem with python2.2-pygresql and python-2.3-pygresql, so please
250  install python2.1-pygresql and use Python 2.1 to install and run
251  PyKota. This is not a bug in PyKota, and this should be fixed
252  by Debian in a few days I hope.
[714]253 
[1043]254or 
255
[1086]256  python-ldap must be linked with the OpenLDAP client libraries on the
257  Print Server. The OpenLDAP client libraries' version must match the
258  OpenLDAP version used on the Quota Storage Server.
[1043]259 
[714]260  This list of prerequisite software may change in the future, when
261  PyKota will support more functionnalities you will be given
262  alternatives.
263 
[952]264  Of course the Print Server and the Quota Storage Server can be the
[851]265  very same machine if you've got a tiny network, or you can have
[952]266  multiple Print Servers all storing their quotas on the same Quota
[851]267  Storage Server if you've got a bigger network.
268 
[714]269Then :   
270------
271 
[724]272Download the latest PyKota version from the CVS tree on :
[695]273
[725]274    http://savannah.nongnu.org/projects/pykota
[695]275
[714]276Just type :
[695]277
[725]278    python setup.py install
[695]279
280You may need to be logged in with sufficient privileges (e.g. root)
281
[878]282The installation script will now automatically check if some software
283is missing and ask you if you still want to proceed with the
284installation or abort it completely.
285
[695]286Go to the initscripts subdirectory of PyKota's sources, and choose
287the appropriate storage backend for your configuration. Read
288the associated README file and execute the initialization script
[878]289to create an empty PyKota Storage. Upgrade scripts may be
290provided as well.
[695]291
[1186]292Copy the conf/pykota.conf.sample and  conf/pykotadmin.conf.sample
[1107]293sample configuration files to /etc/pykota/pykota.conf and
[1186]294/etc/pykota/pykotadmin.conf. The installation script tries to do
295this for you if needed and you agreed to this action. You need to
296adapt these files to your own needs. Especially you have to create
297sections named after your own printers, and change the
298administrator's email address which by default is root@localhost.
299Read and try to understand these two very well commented files,
300so that you'll encounter less problems later.
[1198]301
302Also be sure to double check that commands that query printers
[1186]303for their internal page counter work from the command line
304before using them in PyKota's configuration.
[695]305
[1186]306The rest of the installation depends on your printing system :
307
[1185]308  - CUPS Printing System :
[952]309 
[1185]310    Once and for all :
[952]311   
[1185]312        Create a symbolic link to the cupspykota backend
313        in CUPS's backend directory :
314       
315          $ cd /usr/lib/cups/backend
[1345]316          $ ln -s /usr/share/pykota/cupspykota cupspykota
[1185]317         
318        Restart CUPS so that the new backend can be detected.
319       
320          $ /etc/init.d/cupsys restart
321         
322    For new printers :
[952]323   
[1185]324        Go to CUPS management interface (http://localhost:631)
325        and choose the appropriate PyKota managed device depending
326        on the type of printer you use. For example, if your
327        printer is waiting on :
328       
[1354]329            socket://myprinter.example.com:9100
[1185]330           
331        Then choose :   
332       
[1354]333            cupspykota:socket://myprinter.example.com:9100
[1185]334           
335        Configure your printer as usual.   
336       
[1186]337        Now double check /etc/pykota/pykota.conf
338        This file should contain a section named after the
[1402]339        printer you've just added, unless you have set
340        all options globally.
[1408]341        The new pkhint command can help you with correct settings
342        for your printers, but don't rely on it because it is still
343        incomplete.
[1186]344       
[1185]345        That's all.
[952]346   
[1185]347    For existing printers :
348   
[1186]349        If you had already installed a version of PyKota earlier
350        than 1.16alpha7, then remove the *cupsFilter lines in your
351        PPD files for each printer already managed printers. Each
352        line to remove is of the form :
[1185]353       
[1345]354          *cupsFilter: "application/vnd.cups-postscript 0 /usr/share/pykota/pykota"
[1185]355       
[1345]356        This means that each time the pstops filter will be executed, it will
357        pass the job's data through the pykota filter which is present in
358        /usr/share/pykota
359       
[1185]360        Don't touch anything else, especially any other *cupsFilter line.
[1186]361        Then save each of these files.
[1185]362       
363        Then, the easiest is to directly modify the DeviceURI lines
364        in /etc/cups/printers.conf, you just have to put
365        'cupspykota:' in front of what is already on these lines.
366        For example, replace :
367   
[1354]368            DeviceURI socket://myprinter.example.com:9100
[1185]369       
370        with :   
371   
[1354]372            DeviceURI cupspykota:socket://myprinter.example.com:9100
[1345]373           
374        or :   
[1185]375       
[1354]376            DeviceURI cupspykota://socket://myprinter.example.com:9100
[1345]377       
[1185]378        Save the file and restart CUPS.
[695]379
[1185]380  - LPRng Printing System :
[952]381 
[1500]382      For now LPRng support in PyKota is deactivated. Please be patient.
383     
[1186]384Now you can begin to populate the PyKota's database with printers,
385users and groups :
[952]386 
[716]387Add printers and users to the quota system and set their quota values :
[695]388
[1345]389Starting from version 1.18alpha2, the preferred command to manage
390printers is named pkprinters
391
392    $ pkprinters --help
393   
394    will tell you how to create, manage or delete printers and
395    printers groups.
[1402]396   
397    $ pkprinters --add --charge 0.05 hp2100
398   
399    would add the printer named hp2100 with a price per page
400    of 0.05 unit.
[1345]401
[1402]402Now set quotas for users on this printer :     
403
[1086]404    $ edpykota --add -P hp2100 -S 40 -H 50 user1 ... userN
[724]405       
[725]406    launching edpykota without any argument or with the --help
407    command line option will show you all the possibilities.
[1086]408   
409    by default, each user is limited by "quota", this means that on
410    each printer he can have a different soft and hard limit.
411    You may want to limit the user by his account balance value,
[1107]412    in which case, the print quota is shared between all printers
[1086]413    instead of being different. To do this, use the following :
414   
415    $ edpykota --add -P hp2100 --limitby balance --balance 10 user1 ... userN
416   
417    This will put 10 $ (or Euros, PyKota doesn't care) on each user's account
418    balance, and tell PyKota to limit them by their account balance value.
419    Whenever they print on any printer, their account balance value is
420    decreased by an amount which depends on the particular price per page
421    and per job that you may have defined on the printer with edpykota's
422    --charge command line option.
[1107]423    Soft and Hard limits are not used if "--limitby balance" is used,
424    but you can define a "poorman"'s threshold in /etc/pykota/pykota.conf
425    to obtain a similar result (warning message when quota is low).
[695]426
[990]427Restart CUPS or LPRng, for example under Debian GNU/Linux systems :         
[695]428
[725]429    $ /etc/init.d/cupsys restart
[990]430   
431  or :
432 
433    $ /etc/init.d/lprng restart
[695]434       
435Your users now should be able to print but not exceed their
436printing quota.
437
[1149]438To see printer quota usage, you can use :
[794]439
440    $ repykota --printer lp
441   
442or :
443
444    $ repykota
445   
446    which will print quota usage for all users on all printers,
[1107]447    along with totals, if you are the root user. If you are
448    a regular user, only your own quota report will be produced.
[794]449   
[1107]450Quota reports are also available remotely by using the CGI script
[1345]451printquota.cgi provided in the cgi-bin/ subdirectory. You can
452also use the CSS stylesheet present in the stylesheets/ subdirectory
[1402]453and put it at your web server's DocumentRoot, to benefit from a nicer
454look, especially quota violations will appear in different colors.
[990]455
[980]456For different security concerns, please give a look at the SECURITY
457file which is part of this software.
[741]458           
[695]459============================================================
460
[958]461Mailing list :
462--------------
463
464  A mailing list is dedicated to Pykota, you can subscribe to it
465  or consult its archives at :
466 
467    http://cgi.librelogiciel.com/mailman/listinfo/pykota
468   
[1181]469IRC :   
470-----
471
472  You can also chat with us :
473 
474        /server irc.freenode.net
475        /join #pykota
476   
[958]477============================================================
478   
[1107]479Please e-mail bugs to the mailing list at : pykota@librelogiciel.com
480or to the main author at : alet@librelogiciel.com (Jerome Alet)
Note: See TracBrowser for help on using the browser.