[695] | 1 | # $Id$ |
---|
| 2 | |
---|
| 3 | PyKota - Print Quota for CUPS |
---|
| 4 | |
---|
| 5 | (c) 2003 Jerome Alet <alet@librelogiciel.com> |
---|
| 6 | You're welcome to redistribute this software under the |
---|
| 7 | terms of the GNU General Public Licence version 2.0 |
---|
| 8 | or, at your option, any higher version. |
---|
| 9 | |
---|
| 10 | You can read the complete GNU GPL in the file COPYING |
---|
| 11 | which should come along with this software, or visit |
---|
| 12 | the Free Software Foundation's WEB site http://www.fsf.org |
---|
| 13 | |
---|
| 14 | ============================================================ |
---|
| 15 | |
---|
| 16 | PyKota is a complete Print Quota system for the Common Unix Printing |
---|
| 17 | System (aka CUPS), which works by directly querying the printers |
---|
| 18 | for the number of pages they have printed. |
---|
| 19 | |
---|
[724] | 20 | Actually only the lazy quota method is implemented. What do I call |
---|
| 21 | lazy method ? |
---|
[695] | 22 | |
---|
[724] | 23 | The lazy method consists in querying the printer via SNMP for |
---|
| 24 | its total pages counter, just before the beginning of a job, and |
---|
| 25 | use this to modify the *preceding* user's quota. So you're |
---|
| 26 | always late of one print job, but this is generally ok, especially |
---|
| 27 | because a check is also done to see if the current user is allowed |
---|
| 28 | or not to print. |
---|
| 29 | |
---|
| 30 | Problem may arise however in batches on successive print jobs |
---|
[727] | 31 | by different users when there's no sleep time between two jobs : |
---|
[724] | 32 | the used pages may be attributed to incorrect user. This |
---|
| 33 | depends on the printer speed and time between jobs. |
---|
| 34 | |
---|
| 35 | Other querying methods which won't suffer from this problem, |
---|
| 36 | but probably from other ones ;-) will be implemented in the |
---|
| 37 | future. |
---|
| 38 | |
---|
[726] | 39 | PyKota is known to work fine with HP Laserjet 2100 and 2200 |
---|
[724] | 40 | networked printers. |
---|
| 41 | |
---|
| 42 | Planned features are : |
---|
| 43 | |
---|
| 44 | - Easier installation. |
---|
[695] | 45 | |
---|
[726] | 46 | - Per printer Group quotas. Currently Group |
---|
[695] | 47 | quotas are only at skeleton stage. |
---|
| 48 | |
---|
| 49 | - Configurable printer querying methods. Currently |
---|
| 50 | only SNMP method is supported. |
---|
[724] | 51 | |
---|
| 52 | - More Quota Storage backends. |
---|
[695] | 53 | |
---|
| 54 | ============================================================ |
---|
| 55 | |
---|
| 56 | INSTALLATION: |
---|
| 57 | ============= |
---|
| 58 | |
---|
[714] | 59 | Prerequisite : |
---|
| 60 | -------------- |
---|
| 61 | |
---|
| 62 | You need to have the following tools installed on the CUPS Server : |
---|
| 63 | |
---|
| 64 | - CUPS |
---|
| 65 | - Python |
---|
| 66 | - eGenix' mxDateTime Python extension |
---|
| 67 | - PostgreSQL's PygreSQL Python extension and the PostgreSQL client |
---|
| 68 | libraries. |
---|
| 69 | - SNMP tools (specifically the snmpget command) |
---|
| 70 | |
---|
| 71 | You need to have the following tools installed on the Quota Storage |
---|
| 72 | Server : |
---|
| 73 | |
---|
| 74 | - PostgreSQL |
---|
| 75 | |
---|
| 76 | PygreSQL and the PostgreSQL client libraries's versions on the CUPS |
---|
| 77 | Server must match the PostgreSQL version used on the Quota Storage |
---|
| 78 | Server. |
---|
| 79 | |
---|
| 80 | Of course the CUPS Server and the Quota Storage Server can be the |
---|
| 81 | very same machine. |
---|
| 82 | |
---|
| 83 | This list of prerequisite software may change in the future, when |
---|
| 84 | PyKota will support more functionnalities you will be given |
---|
| 85 | alternatives. |
---|
| 86 | |
---|
| 87 | Then : |
---|
| 88 | ------ |
---|
| 89 | |
---|
[724] | 90 | Download the latest PyKota version from the CVS tree on : |
---|
[695] | 91 | |
---|
[725] | 92 | http://savannah.nongnu.org/projects/pykota |
---|
[695] | 93 | |
---|
[714] | 94 | Just type : |
---|
[695] | 95 | |
---|
[725] | 96 | python setup.py install |
---|
[695] | 97 | |
---|
| 98 | You may need to be logged in with sufficient privileges (e.g. root) |
---|
| 99 | |
---|
| 100 | Go to the initscripts subdirectory of PyKota's sources, and choose |
---|
| 101 | the appropriate storage backend for your configuration. Read |
---|
| 102 | the associated README file and execute the initialization script |
---|
| 103 | to create an empty PyKota Storage. |
---|
| 104 | |
---|
| 105 | Copy the conf/pykota.conf.sample sample configuration file to |
---|
| 106 | CUPS' configuration directory, usually /etc/cups, under the |
---|
[714] | 107 | name pykota.conf, and adapt this file to your own needs and |
---|
| 108 | configuration. |
---|
[695] | 109 | |
---|
| 110 | Modify the PPD files for each printer on which you want to manage |
---|
| 111 | print quotas, for example /etc/cups/ppd/lp.ppd : |
---|
| 112 | |
---|
| 113 | --- Add the line below exactly as-is somewhere near the top --- |
---|
[702] | 114 | *cupsFilter: "application/vnd.cups-postscript 0 /usr/bin/pykota" |
---|
[695] | 115 | --- Add the line above exactly as-is somewhere near the top --- |
---|
| 116 | |
---|
[724] | 117 | Modify the path to the pykota executable if needed, unfortunately |
---|
| 118 | you have to supply the correct absolute path here due to CUPS |
---|
| 119 | internals, or put the pykota executable into /usr/lib/cups/filter |
---|
| 120 | instead of into /usr/bin. |
---|
[702] | 121 | |
---|
[724] | 122 | Do this for each ppd file present in this directory if you want |
---|
[695] | 123 | to enable quota on every printer. |
---|
| 124 | |
---|
[716] | 125 | Add printers and users to the quota system and set their quota values : |
---|
[695] | 126 | |
---|
[725] | 127 | $ edpykota --add -P printer -S softlimit -H hardlimit user1 ... userN |
---|
[724] | 128 | |
---|
[725] | 129 | launching edpykota without any argument or with the --help |
---|
| 130 | command line option will show you all the possibilities. |
---|
[695] | 131 | |
---|
| 132 | Restart CUPS, for example under Debian GNU/Linux systems : |
---|
| 133 | |
---|
[725] | 134 | $ /etc/init.d/cupsys restart |
---|
[695] | 135 | |
---|
| 136 | Your users now should be able to print but not exceed their |
---|
| 137 | printing quota. |
---|
| 138 | |
---|
[724] | 139 | WARNING : as of today, 2003-02-06, group quotas are not |
---|
| 140 | implemented. |
---|
| 141 | |
---|
[695] | 142 | ============================================================ |
---|
| 143 | |
---|
| 144 | Please e-mail bugs to: alet@librelogiciel.com (Jerome Alet) |
---|