89 | | Actually only the lazy quota method is implemented. What do I call |
90 | | lazy method ? |
91 | | |
92 | | The lazy method consists in querying the printer (actually via SNMP |
93 | | or Netatalk) for its total pages counter, just before the beginning |
94 | | of a job, and use this to modify the *preceding* user's quota. So |
95 | | you're always late of one print job, but this is generally ok, |
96 | | especially because a check is also done to see if the current user |
97 | | is allowed or not to print. |
98 | | |
99 | | Problem may theorically arise in batches of successive print jobs by |
100 | | different users when there's no sleep time between two jobs : the |
101 | | used pages may theorically be attributed to an incorrect user in the |
102 | | case that the printer is asked for its page counter at the beginning |
103 | | of a new job and before the end of the previous job. This depends on |
104 | | the printer speed and time between jobs, but so far I've not seen |
105 | | any problem with moderately used printers. This also depends on the |
106 | | printing system's internal behavior : if it doesn't begin to send a |
107 | | job to a printer before the previous one is completely printed, then |
108 | | there's no problem. |
109 | | |
110 | | Other querying methods which won't suffer from this possible |
111 | | problem, but probably from other ones ;-) will be implemented in the |
112 | | future. |
| 94 | Actually three (or an infinity of) page accounting methods are |
| 95 | implemented : |
| 96 | |
| 97 | - The 'querying' method consists in querying the printer (via SNMP |
| 98 | or Netatalk) for its total pages counter, just before the beginning |
| 99 | of a job, and use this to modify the *preceding* user's quota. So |
| 100 | you're always late of one print job, but this is generally ok, |
| 101 | especially because a check is also done to see if the current user |
| 102 | is allowed or not to print. You're not limited to SNMP or Netatalk, |
| 103 | because you can also use any external command instead if you want. |
| 104 | |
| 105 | - The 'external' method consists in delegating the computation of the |
| 106 | job's size in number of pages to any external command of your choice. |
| 107 | The command can read the job's data from its standard input and MUST |
| 108 | output the job's size on its standard output. |
| 109 | |
| 110 | - The 'stupid' method consists in counting the 'showpage' PostSript |
| 111 | statements in the job. THIS IS UNRELIABLE, but can serve as an |
| 112 | example if you plan to write your own accounting method for |
| 113 | integration into PyKota. |
115 | | Apple LaserWriter 16/600 PS. |
116 | | |
117 | | It should also work fine with any printer capable of outputing |
118 | | its lifetime printed pages counter via either SNMP or AppleTalk. |
119 | | |
120 | | If your printers don't support SNMP or AppleTalk, then making them |
121 | | work with PyKota is up to you. Some sample scripts which can query |
122 | | non-SNMP printers for their lifetime page counter are included in |
123 | | the ./untested directory. You'll have to test and adapt them though, |
124 | | and define them as external requesters in the PyKota configuration |
125 | | file. See the sample configuration file to learn how to do that. |
| 116 | Apple LaserWriter 16/600 PS, both with CUPS and LPRng, under |
| 117 | Debian GNU/Linux (Sarge and Sid) operating systems. |
| 118 | |
| 119 | I'm interested in receiving success or failure reports with other |
| 120 | brands or models of printers, as well as with other operating |
| 121 | systems. |
263 | | SECURITY : You should ensure that only the print quota administrator |
264 | | can run the warnpykota command, but this is actually not |
265 | | enforced in the program. Any user able to launch warnpykota |
266 | | could flood over-quota users' email boxes. |
267 | | |
268 | | You should ensure that only the print quota administrator |
269 | | can run the edpykota command, but this is actually not |
270 | | enforced in the program. Otherwise, any user could modify |
271 | | his/her or other people's print quota. |
272 | | |
273 | | launching : chmod 750 /usr/bin/warnpykota /usr/bin/edpykota |
274 | | should make you reasonably safe. |
275 | | |
276 | | also please ensure that only the printing daemon user |
277 | | can launch the pykota command. Again this is not enforced |
278 | | in the program. |
| 259 | For different security concerns, please give a look at the SECURITY |
| 260 | file which is part of this software. |