root / pykota / trunk / README @ 851

Revision 851, 8.3 kB (checked in by jalet, 21 years ago)

More complete installation procedure, especially wrt non-postscript
printers.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1# $Id$
2
3PyKota - Print Quota for CUPS
4
5(c) 2003 Jerome Alet <alet@librelogiciel.com>
6You're welcome to redistribute this software under the
7terms of the GNU General Public Licence version 2.0
8or, at your option, any higher version.
9
10You can read the complete GNU GPL in the file COPYING
11which should come along with this software, or visit
12the Free Software Foundation's WEB site http://www.fsf.org
13
14====================================================================
15
16READ SPECIAL LICENSING AND REDISTRBUTION TERMS IN THE FILE 'LICENSE'
17
18====================================================================
19
20PyKota is a complete Print Quota system for the Common Unix Printing
21System (aka CUPS), which works by directly querying the printers
22for the number of pages they have printed.
23
24Actual working features :
25
26        - Per printer user quotas.
27       
28        - Automated email warning of users above quota to the
29          user himself and to the print quota administrator.
30       
31        - CUPS filter for quota accounting : pykota
32       
33        - Command line print quota editor : edpykota
34       
35        - Command line print quota report generator : repykota
36       
37        - Command line print quota automated warning sender : warnpykota
38       
39        - Command line tools mimic the disk quota utilities for
40          easier mastering.
41       
42        - Centralized storage of quotas : you can manage quotas for
43          different printers on different print servers and store them all
44          on the same quota storage server.
45          WARNING : actually all your printers must have an unique name,
46                    but this may change in a future version.
47                   
48        - SNMP querying of any networked SNMP-enabled printer.
49       
50        - External command querying of any printer : you can use
51          you own querying command, e.g. to query a printer via
52          the serial port, sending it a special PJL job and
53          reading the result. See the example scripts in the
54          "untested" directory and try to adapt them to your
55          configuration.
56       
57        - Special scripts included for a seamless integration of
58          PyKota on Debian machines.
59         
60All the command line tools accept the -h | --help command line option
61which prints all the available options and show usage examples.
62       
63Planned features are described in the TODO file.
64
65Actually only the lazy quota method is implemented. What do I call
66lazy method ?
67
68  The lazy method consists in querying the printer (actually via SNMP)
69  for its total pages counter, just before the beginning of a job, and
70  use this to modify the *preceding* user's quota. So you're
71  always late of one print job, but this is generally ok, especially
72  because a check is also done to see if the current user is allowed
73  or not to print.
74 
75  Problem may theorically arise in batches of successive print jobs by
76  different users when there's no sleep time between two jobs : the
77  used pages may theorically be attributed to an incorrect user in the
78  case that the printer is asked for its page counter at the beginning
79  of a new job and before the end of the previous job. This depends on
80  the printer speed and time between jobs, but so far I've not seen
81  any problem with moderately used printers. This also depends on CUPS
82  internal behavior : if CUPS doesn't begin to send a job to a printer
83  before the previous one is completely printed, then there's no
84  problem.
85 
86  Other querying methods which won't suffer from this possible
87  problem, but probably from other ones ;-) will be implemented in the
88  future.
89 
90PyKota is known to work fine with HP Laserjet 2100 and 2200   
91networked printers, and should work with any SNMP-enabled
92network printer capable of outputing its lifetime printed pages
93number.
94
95============================================================
96
97INSTALLATION:
98=============
99
100Prerequisite :
101--------------
102   
103  You need to have the following tools installed on the CUPS Server :
104 
105    - CUPS
106    - Python v2.1 or above
107    - eGenix' mxDateTime Python extension
108    - PostgreSQL's PygreSQL Python extension and the PostgreSQL client
109      libraries.
110    - SNMP tools (specifically the snmpget command)
111   
112  You need to have the following tools installed on the Quota Storage 
113  Server :
114 
115    - PostgreSQL
116   
117  PygreSQL and the PostgreSQL client libraries's versions on the CUPS
118  Server must match the PostgreSQL version used on the Quota Storage
119  Server.
120 
121  This list of prerequisite software may change in the future, when
122  PyKota will support more functionnalities you will be given
123  alternatives.
124 
125  Of course the CUPS Server and the Quota Storage Server can be the
126  very same machine if you've got a tiny network, or you can have
127  multiple CUPS Servers all storing their quotas on the same Quota
128  Storage Server if you've got a bigger network.
129 
130Then :   
131------
132 
133Download the latest PyKota version from the CVS tree on :
134
135    http://savannah.nongnu.org/projects/pykota
136
137Just type :
138
139    python setup.py install
140
141You may need to be logged in with sufficient privileges (e.g. root)
142
143Go to the initscripts subdirectory of PyKota's sources, and choose
144the appropriate storage backend for your configuration. Read
145the associated README file and execute the initialization script
146to create an empty PyKota Storage.
147
148Copy the conf/pykota.conf.sample sample configuration file to
149CUPS' configuration directory, usually /etc/cups, under the
150name pykota.conf, and adapt this file to your own needs and
151configuration.
152
153Modify the PPD files for each printer on which you want to manage
154print quotas, for example /etc/cups/ppd/lp.ppd :
155
156--- Add the line below exactly as-is somewhere near the top ---
157*cupsFilter:  "application/vnd.cups-postscript 0 /usr/bin/pykota"
158--- Add the line above exactly as-is somewhere near the top  ---
159
160Modify the path to the pykota executable if needed, unfortunately
161you have to supply the correct absolute path here due to CUPS
162internals, or put the pykota executable into /usr/lib/cups/filter
163instead of into /usr/bin.
164
165Do this for each ppd file present in this directory if you want
166to enable quota on every printer.
167         
168WARNING : In the case you've got a non-postscript printer, chances
169          are that the *cupsFilter is already filled-in and points
170          to cupsomatic or such a print filter. In this case please
171          check if you can switch your printer to PostScript mode
172          or if there's a way to make it accept PostScript jobs.
173          If yes then ensure that your workstations uses a PostScript
174          printer driver, and replace the *cupsFilter line with the
175          one pointing to the pykota filter. This should work, but
176          is currently untested.
177          If your printer really needs the original *cupsFilter line
178          then you may not be able to use PyKota easily for now.
179
180Add printers and users to the quota system and set their quota values :
181
182    $ edpykota --add -P printer -S softlimit -H hardlimit user1 ... userN
183       
184    launching edpykota without any argument or with the --help
185    command line option will show you all the possibilities.
186
187Restart CUPS, for example under Debian GNU/Linux systems :         
188
189    $ /etc/init.d/cupsys restart
190       
191Your users now should be able to print but not exceed their
192printing quota.
193
194To see printer command usage, you can use :
195
196    $ repykota --printer lp
197   
198or :
199
200    $ repykota
201   
202    which will print quota usage for all users on all printers,
203    along with totals.
204   
205WARNING : as of today, 2003-02-06, group quotas are not
206implemented.
207
208SECURITY : You should ensure that only the print quota administrator
209           can run the warnpykota command, but this is actually not
210           enforced in the program. Any user able to launch warnpykota
211           could flood over-quota users' email boxes.
212           
213           You should ensure that only the print quota administrator
214           can run the edpykota command, but this is actually not
215           enforced in the program. Any user could modify his/her
216           or other people's print quota.
217         
218           launching : chmod 750 /usr/bin/warnpykota /usr/bin/edpykota
219           should make you reasonably safe.
220           
221============================================================
222
223Please e-mail bugs to: alet@librelogiciel.com (Jerome Alet)
Note: See TracBrowser for help on using the browser.