1 | # PyKota sample configuration file |
---|
2 | # |
---|
3 | # |
---|
4 | # File format : |
---|
5 | # |
---|
6 | # - A mandatory [global] section : |
---|
7 | # |
---|
8 | # Contains configuration directives which apply for all printers. |
---|
9 | # Some directives MUST be set in the [global] section, e.g. |
---|
10 | # database related directives. |
---|
11 | # |
---|
12 | # - Any number of optional [PrintQueueName] sections : |
---|
13 | # |
---|
14 | # Contain directives which apply for a particular print queue only. |
---|
15 | # |
---|
16 | # Override the values of the same directives present in [global]. |
---|
17 | # |
---|
18 | # |
---|
19 | # Directives format : |
---|
20 | # |
---|
21 | # - Directive's name, followed by ':' followed by the directive's value. |
---|
22 | # |
---|
23 | # - No leading whitespace : leading whitespace tell the parser that the |
---|
24 | # current directive is the continuation of the previous one. Use with |
---|
25 | # care and only when you need it. |
---|
26 | # |
---|
27 | # |
---|
28 | # PyKota - Print Quotas for CUPS and LPRng |
---|
29 | # |
---|
30 | # (c) 2003, 2004, 2005, 2006 Jerome Alet <alet@librelogiciel.com> |
---|
31 | # This program is free software; you can redistribute it and/or modify |
---|
32 | # it under the terms of the GNU General Public License as published by |
---|
33 | # the Free Software Foundation; either version 2 of the License, or |
---|
34 | # (at your option) any later version. |
---|
35 | # |
---|
36 | # This program is distributed in the hope that it will be useful, |
---|
37 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
38 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
39 | # GNU General Public License for more details. |
---|
40 | # |
---|
41 | # You should have received a copy of the GNU General Public License |
---|
42 | # along with this program; if not, write to the Free Software |
---|
43 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
44 | # |
---|
45 | # $Id$ |
---|
46 | # |
---|
47 | |
---|
48 | [global] |
---|
49 | # Storage backend for quotas |
---|
50 | # only PGStorage (PostgreSQL), LDAPStorage (OpenLDAP or else), |
---|
51 | # MySQLStorage (MySQL) and SQLiteStorage (SQLite 3) are supported. |
---|
52 | # |
---|
53 | # BerkeleyDB is planned. |
---|
54 | |
---|
55 | #################################################################### |
---|
56 | # SQLite3 : comment this section out if you use another backend # |
---|
57 | #################################################################### |
---|
58 | |
---|
59 | #storagebackend : sqlitestorage |
---|
60 | #storagename: /etc/pykota/pykota.db |
---|
61 | |
---|
62 | ############################################################################ |
---|
63 | # PostgreSQL or MySQL: comment this section out if you use another backend # |
---|
64 | ############################################################################ |
---|
65 | storagebackend: pgstorage |
---|
66 | # storagebackend: mysqlstorage |
---|
67 | |
---|
68 | # Quota Storage Server hostname (and optional port) |
---|
69 | # e.g. db.example.com:5432 |
---|
70 | storageserver: localhost |
---|
71 | |
---|
72 | # |
---|
73 | # name of the Quota Storage Database |
---|
74 | storagename: pykota |
---|
75 | |
---|
76 | # |
---|
77 | # Quota Storage normal user's name and password |
---|
78 | # These two fields contain a username and optional password |
---|
79 | # which may give readonly access to your print quota database. |
---|
80 | # |
---|
81 | # PLEASE ENSURE THAT THIS USER CAN'T WRITE TO YOUR PRINT QUOTA |
---|
82 | # DATABASE, OTHERWISE ANY USER WHO COULD READ THIS CONFIGURATION |
---|
83 | # FILE COULD CHANGE HIS PRINT QUOTA. |
---|
84 | # |
---|
85 | storageuser: pykotauser |
---|
86 | # storageuserpw: Comment out if unused, or set to Quota Storage user password |
---|
87 | |
---|
88 | #################################################################### |
---|
89 | # LDAP : comment this section out if you use another backend # |
---|
90 | #################################################################### |
---|
91 | # LDAP example, uncomment and adapt it to your own configuration : |
---|
92 | #storagebackend: ldapstorage |
---|
93 | #storageserver: ldap://ldap.example.com:389 |
---|
94 | #storagename: dc=example,dc=com |
---|
95 | # |
---|
96 | # NB : the user and password below are the ones contained in |
---|
97 | # the sample LDIF file pykota/initscripts/ldap/pykota-sample.ldif |
---|
98 | # Please adapt these lines to your own needs. |
---|
99 | #storageuser: cn=pykotauser,dc=example,dc=com |
---|
100 | #storageuserpw: ls88DT5j |
---|
101 | # |
---|
102 | # TLS support for LDAP |
---|
103 | # |
---|
104 | # ldaptls can be set to either Yes or No |
---|
105 | # the default value when not set is No, meaning that TLS won't be used. |
---|
106 | #ldaptls: No |
---|
107 | # |
---|
108 | # cacert points to the CA Certificate file to use for TLS. |
---|
109 | # Ensure that every user who can launch PyKota commands can read this file. |
---|
110 | # There's NO default value for this directive. |
---|
111 | #cacert: /etc/pykota/mycertfile |
---|
112 | # |
---|
113 | # |
---|
114 | # Here we define some helpers to know where |
---|
115 | # to plug into an existing LDAP directory |
---|
116 | #userbase: ou=People,dc=example,dc=com |
---|
117 | #userrdn: uid |
---|
118 | #balancebase: ou=People,dc=example,dc=com |
---|
119 | #balancerdn: uid |
---|
120 | #groupbase: ou=Groups,dc=example,dc=com |
---|
121 | #grouprdn: cn |
---|
122 | #printerbase: ou=Printers,ou=PyKota,dc=example,dc=com |
---|
123 | #printerrdn: cn |
---|
124 | #jobbase: ou=Jobs,ou=PyKota,dc=example,dc=com |
---|
125 | #lastjobbase: ou=LastJobs,ou=PyKota,dc=example,dc=com |
---|
126 | #billingcodebase: ou=BillingCodes,ou=PyKota,dc=example,dc=com |
---|
127 | |
---|
128 | # These two fields are special, they either accept a branch |
---|
129 | # dn, like an ou for example, or the special keywords 'user' |
---|
130 | # and 'group'. If 'user' or 'group' is used, the print quota |
---|
131 | # entries will be created below the user or group entry itself, |
---|
132 | # which will then be used like a branch (you can mix and match |
---|
133 | # different values depending on what you want to do). |
---|
134 | #userquotabase: user |
---|
135 | #userquotabase: ou=UQuotas,ou=PyKota,dc=example,dc=com |
---|
136 | #groupquotabase: group |
---|
137 | #groupquotabase: ou=GQuotas,ou=PyKota,dc=example,dc=com |
---|
138 | |
---|
139 | # |
---|
140 | # How to create new accounts and groups |
---|
141 | # authorized values are "below" and "attach(objectclass name [, fail|warn])" |
---|
142 | # |
---|
143 | # "below" creates the new accounts/groups as standalone entries |
---|
144 | # below the above defined 'userbase' ou |
---|
145 | # |
---|
146 | # attach(objectclass name [, action]) tries to find some existing user/group |
---|
147 | # using the above defined 'userrdn' or 'grouprdn' and 'userbase' |
---|
148 | # 'groupbase', and attach the PyKota specific entries to it. |
---|
149 | # if action is "warn" and no entry exists to attach to, a new |
---|
150 | # entry is created, and a message is logged. |
---|
151 | # if action is "fail" and no entry exists to attach to, program |
---|
152 | # logs an error message and aborts. |
---|
153 | # if action is not set, the default value is "fail". |
---|
154 | # |
---|
155 | # a possible value: newuser: attach(posixAccount, warn) |
---|
156 | #newuser : below |
---|
157 | #newgroup : below |
---|
158 | # |
---|
159 | # LDAP attribute which stores the user's email address |
---|
160 | #usermail : mail |
---|
161 | |
---|
162 | # |
---|
163 | # Choose what attribute contains the list of group members |
---|
164 | # common values are : memberUid, uniqueMember, member |
---|
165 | #groupmembers: memberUid |
---|
166 | |
---|
167 | # Activate low-level LDAP cache yes/no |
---|
168 | # Nothing to do with "storagecaching" which is higher level |
---|
169 | # and database independant. |
---|
170 | # This saves some search queries and may help with heavily |
---|
171 | # loaded LDAP servers. |
---|
172 | # This is EXPERIMENTAL. |
---|
173 | # |
---|
174 | # BEWARE : SETTING THIS TO 'YES' CAUSES PROBLEMS FOR NOW |
---|
175 | # BETTER TO LET IT SET TO 'NO' |
---|
176 | # ldapcache: no |
---|
177 | |
---|
178 | ############################################################# |
---|
179 | # ALL directives below are common to ALL storage backends # |
---|
180 | ############################################################# |
---|
181 | |
---|
182 | # Should the database caching mechanism be enabled or not ? |
---|
183 | # If unset, caching is disabled. Possible values Y/N/YES/NO |
---|
184 | # caching mechanism works with both PostgreSQL and OpenLDAP backends |
---|
185 | # but may be really interesting only with OpenLDAP. |
---|
186 | # |
---|
187 | # ACTIVATING CACHE MAY CAUSE PRECISION PROBLEMS IN PRINT ACCOUNTING |
---|
188 | # IF AN USER PRINTS ON SEVERAL PRINTERS AT THE SAME TIME. |
---|
189 | # YOU MAY FIND IT INTERESTING ANYWAY, ESPECIALLY FOR LDAP. |
---|
190 | # |
---|
191 | # FYI, I ALWAYS SET IT TO YES ! |
---|
192 | # |
---|
193 | storagecaching: No |
---|
194 | |
---|
195 | # Should full job history be disabled ? |
---|
196 | # If unset or set to No, full job history is kept in the database. |
---|
197 | # This will be useful in the future when the report generator |
---|
198 | # will be written. |
---|
199 | # Disabling the job history can be useful with heavily loaded |
---|
200 | # LDAP servers, to not make the LDAP tree grow out of control. |
---|
201 | # Disabling the job history with the PostgreSQL backend works too |
---|
202 | # but it's probably less useful than with LDAP. |
---|
203 | disablehistory: No |
---|
204 | |
---|
205 | |
---|
206 | # Where to log ? |
---|
207 | # supported values : stderr, system (system means syslog, but don't use 'syslog' here) |
---|
208 | # if the value is not set then the default SYSTEM applies. |
---|
209 | logger: system |
---|
210 | |
---|
211 | # Enable debugging ? Put YES or NO there. |
---|
212 | # debug is set to YES in this sample configuration file, so debugging |
---|
213 | # is activated when configuring PyKota, which helps a lot. After all |
---|
214 | # works, just put NO instead to save some disk space in your logs. |
---|
215 | # NB : When set to YES, there is a very significant impact on performance |
---|
216 | # when managing many users, printers or billing codes at once, because |
---|
217 | # hundreds of thousands of log lines can be generated. |
---|
218 | # When printing a job, typically around 250-300 log lines are generated, |
---|
219 | # so the impact per job is really minimal. Note however that this will |
---|
220 | # add up over a large number of jobs. |
---|
221 | debug : Yes |
---|
222 | |
---|
223 | # |
---|
224 | # The URL to PyKota's logo when used from the CGI scripts. |
---|
225 | # You can use your own logo by modifying the URL below. |
---|
226 | # If not defined, the default URL is the same as the |
---|
227 | # one defined below |
---|
228 | logourl : http://www.librelogiciel.com/software/PyKota/pykota.png |
---|
229 | |
---|
230 | # |
---|
231 | # The destination to which the web browser will be redirected |
---|
232 | # when you click on the logo defined above. |
---|
233 | # If not defined, the default URL is the same as the |
---|
234 | # one defined below |
---|
235 | logolink : http://www.librelogiciel.com/software/ |
---|
236 | |
---|
237 | # |
---|
238 | # Mail server to use to warn users |
---|
239 | # If the value is not set then localhost is used. |
---|
240 | smtpserver: localhost |
---|
241 | |
---|
242 | # Crash messages' recipient : in addition to the log files |
---|
243 | # each software crash can be sent to the author of PyKota |
---|
244 | # or any other person of your choice. By default this |
---|
245 | # is disabled. The recipient pykotacrashed@librelogiciel.com |
---|
246 | # reaches PyKota's author. |
---|
247 | # The 'adminmail' (defined a bit below) is CCed. |
---|
248 | # |
---|
249 | # Privacy concerns : what is sent is only : |
---|
250 | # |
---|
251 | # - a copy of the software's traceback |
---|
252 | # - a copy of the software's command line arguments |
---|
253 | # - a copy of the software's environment variables |
---|
254 | # |
---|
255 | # suggested value |
---|
256 | # crashrecipient: pykotacrashed@librelogiciel.com |
---|
257 | |
---|
258 | # Email domain |
---|
259 | # If the value is not set, and the mail attribute for the user |
---|
260 | # is not set in the PyKota storage, be it LDAP (see usermail directive |
---|
261 | # above) or PostgreSQL, then email messages are sent to |
---|
262 | # username@smtpserver |
---|
263 | # |
---|
264 | # If the value is set, then email messages are sent to |
---|
265 | # username@maildomain using the SMTP server defined above |
---|
266 | # |
---|
267 | # Set the appropriate value below, example.com set as per RFC2606. |
---|
268 | maildomain: example.com |
---|
269 | |
---|
270 | # Should we force usernames to be all lowercase when printing ? |
---|
271 | # Default is No. |
---|
272 | # This is a global option only. |
---|
273 | # Some people reported that WinXP sends mixed case usernames |
---|
274 | # setting 'utolower: Yes' solves the problem. |
---|
275 | # Of course you have to use lowercase only when adding |
---|
276 | # users with edpykota, because ALL database accesses are |
---|
277 | # still case sensitive. |
---|
278 | # |
---|
279 | # If utolower is Yes, the usernames received from the printing |
---|
280 | # system is converted to lowercase at the start of printing, |
---|
281 | # BUT ONLY when printing. |
---|
282 | # |
---|
283 | # If utolower is No, which is the default, strict case checking |
---|
284 | # is done, this means that users 'Jerome' and 'jerome' are |
---|
285 | # different. Printer and groups names are ALWAYS case sensitive. |
---|
286 | utolower: No |
---|
287 | |
---|
288 | # Should we split usernames on a specific separator when printing ? |
---|
289 | # Default is No, i.e. if the value is unset. |
---|
290 | # This is a global option only. |
---|
291 | # This option adds support for Samba's Winbind utility, which |
---|
292 | # prefixes usernames with domain name and separator character. |
---|
293 | # Of course if you set this then you have to use NO separator when |
---|
294 | # adding users with edpykota. |
---|
295 | # |
---|
296 | # If winbind_separator is set, the usernames received from the printing |
---|
297 | # system are split on the separator's value, and only the last part |
---|
298 | # (real username) is used. |
---|
299 | # |
---|
300 | # If winbind_separator is not set, which is the default, strict |
---|
301 | # username equality checking will be done (modulo the setting |
---|
302 | # of the 'utolower' directive), this means that users 'DOMAIN1/jerome', |
---|
303 | # 'Domain2/jerome' and 'jerome' are different. |
---|
304 | # winbind_separator: / |
---|
305 | |
---|
306 | # When creating users or groups accounts, should we reject users |
---|
307 | # or groups which are unknown from the system ? |
---|
308 | # The default if unset is NO. This means that by default, you |
---|
309 | # can create users or groups for which `getent passwd username` |
---|
310 | # or `getent group groupname` returns nothing. |
---|
311 | # |
---|
312 | # Allowed values : Yes | No |
---|
313 | # Default value : No |
---|
314 | # |
---|
315 | # reject_unknown: No |
---|
316 | |
---|
317 | # Do we want to hide jobs' title, filename and options for privacy |
---|
318 | # reasons ? |
---|
319 | # This may be required in some countries (Italy comes to mind). |
---|
320 | # Allowed values are YES and NO. |
---|
321 | # If unset, the default value is NO, meaning that jobs' title, filename |
---|
322 | # and options will be saved into the history. |
---|
323 | # This option can't be set on a per printer basis, only into the |
---|
324 | # [global] section. |
---|
325 | privacy : no |
---|
326 | |
---|
327 | # When the real CUPS backend fail, should we modify the |
---|
328 | # user's page counters and account balance or not ? |
---|
329 | # If you trust your users, set it to "nocharge". |
---|
330 | # If you think they found some mean to kill the real CUPS backend, |
---|
331 | # then set it to "charge". |
---|
332 | # If unset, the default value is "nocharge", meaning that users won't be |
---|
333 | # charged whenever a CUPS backend fails. This is the OPPOSITE |
---|
334 | # behavior compared to PyKota versions prior to 1.24alpha2. |
---|
335 | # This value can be set either globally or on a per printer basis |
---|
336 | # If both are defined, the printer option has priority. |
---|
337 | # onbackenderror : charge |
---|
338 | onbackenderror : nocharge |
---|
339 | |
---|
340 | # Should we strip off some characters from the beginning of |
---|
341 | # print jobs' titles ? This can be used to remove smbprn.?????? |
---|
342 | # which sometimes appear when printing in raw mode from Windows |
---|
343 | # through Samba. |
---|
344 | # This setting only applies at printing time. |
---|
345 | # When not set, titles are used as received from the printing system. |
---|
346 | # The default is to not strip any character off of jobs' titles. |
---|
347 | # This value can be set either globally or on a per printer basis |
---|
348 | # If both are defined, the printer option has priority. |
---|
349 | # striptitle : smbprn.?????? |
---|
350 | |
---|
351 | # Should we launch a command to overwrite the job's ticket ? |
---|
352 | # This allows a command to overwrite the username and/or the |
---|
353 | # billing code used, or to deny or cancel the job. |
---|
354 | # If unset no command is launched and the job's username and |
---|
355 | # billing code are used as they are received. |
---|
356 | # To overwrite the job's ticket, the command has to print |
---|
357 | # on its standard output one or more of the following lines, |
---|
358 | # without any prefix or space character : |
---|
359 | # |
---|
360 | # USERNAME=the_username_we_want_to_overwrite_with |
---|
361 | # BILLINGCODE=the_billingcode_we_want_to_overwrite_with |
---|
362 | # DENY |
---|
363 | # CANCEL |
---|
364 | # |
---|
365 | # NB : the output is entirely read, and the latest value |
---|
366 | # seen is used, so you command can output several usernames |
---|
367 | # or billing codes and only the latest ones will be used. |
---|
368 | # If only USERNAME= lines are printed, the billing code, |
---|
369 | # if any, is used unchanged. |
---|
370 | # If only BILLINGCODE= lines are printed, the username is |
---|
371 | # used unchanged. |
---|
372 | # If DENY or CANCEL is output, but is followed by new USERNAME= or |
---|
373 | # BILLINGCODE= lines, the job is not denied nor cancelled. |
---|
374 | # |
---|
375 | # This value can be set either globally or on a per printer basis |
---|
376 | # If both are defined, the printer option has priority. |
---|
377 | # |
---|
378 | # overwrite_jobticket : /path/to/some/script/or/command |
---|
379 | |
---|
380 | # What should we do when we print and the billing code used is |
---|
381 | # not present in the database ? |
---|
382 | # The default value is 'create' which adds the billing code to the |
---|
383 | # database. |
---|
384 | # Other values can be : |
---|
385 | # deny |
---|
386 | # which silently rejects the job. |
---|
387 | # or : |
---|
388 | # deny(your script here) |
---|
389 | # if you put the path to a script or command here, it is executed, for |
---|
390 | # example you can open a popup window explaining why the job was |
---|
391 | # rejected. |
---|
392 | # |
---|
393 | # This value can be set either globally or on a per printer basis |
---|
394 | # If both are defined, the printer option has priority. |
---|
395 | # |
---|
396 | # unknown_billingcode : deny |
---|
397 | # unknown_billingcode : deny(/path/to/some/script) |
---|
398 | # unknown_billingcode : create |
---|
399 | |
---|
400 | # Where should we store our (temporary) files when printing ? |
---|
401 | # if unset, defaults to a system directory dedicated to temporary |
---|
402 | # files and evaluated at runtime (see Python's documentation |
---|
403 | # for the tempfile.gettempdir() function). |
---|
404 | # This value can be set either globally or on a per printer basis |
---|
405 | # If both are defined, the printer option has priority. |
---|
406 | # On my system, when not set, the /var/spool/cups/tmp directory is used. |
---|
407 | # directory : /tmp |
---|
408 | # directory : /var/spool/cups |
---|
409 | |
---|
410 | # Should we keep our work files on disk after printing ? |
---|
411 | # If unset, temporary files are deleted once the work is finished. |
---|
412 | # If set to yes, files are kept on disk in the 'directory' |
---|
413 | # named with the previous directive. |
---|
414 | # This value can be set either globally or on a per printer basis |
---|
415 | # If both are defined, the printer option has priority. |
---|
416 | # Default value is No, meaning temporary files are deleted |
---|
417 | # keepfiles : yes |
---|
418 | keepfiles : no |
---|
419 | |
---|
420 | |
---|
421 | # What is the accounting backend to use |
---|
422 | # |
---|
423 | # supported values : |
---|
424 | # |
---|
425 | # - hardware : asks the printer for its lifetime page counter |
---|
426 | # via either SNMP, AppleTalk, or any external |
---|
427 | # command. This method is the recommended one |
---|
428 | # in PyKota since its beginning. |
---|
429 | # |
---|
430 | # In the lines below "%(printer)s" is automatically replaced |
---|
431 | # at run time with your printer's Fully Qualified Domain Name |
---|
432 | # for network printers, if PyKota can extract it from its |
---|
433 | # environment. |
---|
434 | # e.g. myprinter.example.com |
---|
435 | # |
---|
436 | # Recommended values : |
---|
437 | # |
---|
438 | # accounter: hardware(snmp) |
---|
439 | # |
---|
440 | # Extracts the printer's internal page counter via SNMP. |
---|
441 | # |
---|
442 | # Or : |
---|
443 | # |
---|
444 | # accounter: hardware(pjl) |
---|
445 | # |
---|
446 | # Extracts the printer's internal page counter via PJL queries over port tcp/9100. |
---|
447 | # |
---|
448 | # Advanced uses : |
---|
449 | # |
---|
450 | # accounter: hardware(snmp:MyCommunity) |
---|
451 | # |
---|
452 | # To use a different SNMP community name than the default one (which is 'public') |
---|
453 | # |
---|
454 | # accounter: hardware(pjl:9101) |
---|
455 | # |
---|
456 | # To use a different port than the default one (which is 9100) |
---|
457 | # |
---|
458 | # |
---|
459 | # Other Examples : |
---|
460 | # |
---|
461 | # accounter: hardware(/usr/bin/snmpget -v1 -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ") |
---|
462 | # |
---|
463 | # Another untested example, using npadmin : |
---|
464 | # |
---|
465 | # accounter: hardware(/usr/bin/npadmin --pagecount %(printer)s) |
---|
466 | # |
---|
467 | # Another example, for AppleTalk printers which works fine : |
---|
468 | # (You may need the pap CUPS backend installed, and copy the |
---|
469 | # pagecount.ps file from untested/netatalk into /etc or any |
---|
470 | # appropriate location) |
---|
471 | # |
---|
472 | # accounter: hardware(/usr/share/pykota/papwaitprinter.sh "MyPrinter:LaserWriter@*" && /usr/bin/pap -p "MyPrinter:LaserWriter@*" /usr/share/pykota/pagecount.ps 2>/dev/null | /bin/grep -v status | /bin/grep -v Connect | /usr/bin/tail -1) |
---|
473 | # |
---|
474 | # An example for parallel printers like the HP Laserjet 5MP : |
---|
475 | # |
---|
476 | # accounter: hardware(/bin/cat /usr/share/pykota/pagecount.pjl >/dev/lp0 && /usr/bin/head -2 </dev/lp0 | /usr/bin/tail -1) |
---|
477 | # |
---|
478 | # This value can be set either globally or per printer or both. |
---|
479 | # If both are defined, the printer option has priority. |
---|
480 | # |
---|
481 | # Some examples and comments provided by Bob Martel from csuohio.edu |
---|
482 | # |
---|
483 | # For several printers I could not get the page count using snmpget. I |
---|
484 | # resorted to snmpwalk: |
---|
485 | # |
---|
486 | # accounter: hardware(/opt/local/net-snmp/bin/snmpwalk -v 1 -Cc -c public %(printer)s | grep mib-2.43.10.2.1.4.1.1 | cut -d " " -f4) |
---|
487 | # |
---|
488 | # The last example is still more ugly, some of the printers only provided |
---|
489 | # their counters without names, but at least always on the same line: |
---|
490 | # |
---|
491 | # accounter: hardware(/opt/local/net-snmp/bin/snmpwalk -v 1 -Cc -c public -Ov %(printer)s | grep Counter32 | tail -2 | head -1 | cut -d " " -f2) |
---|
492 | # |
---|
493 | # An example using netcat and a preformatted PJL job which you can find |
---|
494 | # in the untested/pjl directory, which is sent to a JetDirect print |
---|
495 | # server on port 9100 : |
---|
496 | # |
---|
497 | # accounter: hardware(/bin/nc -w 2 %(printer)s 9100 </usr/share/pykota/pagecount.pjl | /usr/bin/tail -2) |
---|
498 | # |
---|
499 | # An example using the contributed pagecount.pl script which does |
---|
500 | # the same as above, but should work on more printers : |
---|
501 | # |
---|
502 | # accounter: hardware(LC_ALL=C /usr/share/pykota/pagecount.pl %(printer)s 9100) |
---|
503 | # |
---|
504 | # NB : the LC_ALL=C is used because sometimes Perl can correctly set locale and is verbose |
---|
505 | # about it, causing PyKota to miss the correct answer. |
---|
506 | # |
---|
507 | # WARNING : In any case, when using an hardware accounter, please test the command line outside |
---|
508 | # of PyKota before. This will save you some headaches in case it doesn't work as expected. |
---|
509 | # |
---|
510 | # The waitprinter.sh is there to wait until the printer is idle again. |
---|
511 | # This should prevent a job to be sent to the printer while another one is |
---|
512 | # not yet finished (not all pages are printed, but the complete job is in |
---|
513 | # the printer) |
---|
514 | # |
---|
515 | # YOU ABSOLUTELY HAVE TO BE SURE YOU HAVE A SCRIPT WHICH WAITS FOR THE |
---|
516 | # PRINTER BEING READY BEFORE ASKING FOR ITS INTERNAL PAGE COUNTER. |
---|
517 | # |
---|
518 | # PYKOTA INCLUDES SUCH SCRIPTS FOR SNMP AND APPLETALK PRINTERS, MORE TO COME |
---|
519 | # |
---|
520 | # SOME OF THE ABOVE EXAMPLES DON'T USE SUCH A SCRIPT, YOU HAVE BEEN WARNED |
---|
521 | # |
---|
522 | # |
---|
523 | # WITH THE SPECIAL MAGIC hardware(snmp) AND hardware(pjl) VALUES, PYKOTA |
---|
524 | # TAKES CARE OF ALL THIS FOR YOU, SO PLEASE UNDERSTAND THAT IT IS PREFERABLE |
---|
525 | # TO USE THESE TWO METHODS : THEY WORK FINE, REQUIRE LITTLE TO NO CPU, |
---|
526 | # AND DO ALL THE HARD WORK AUTOMATICALLY. IF YOU REALLY NEED TO YOU CAN USE |
---|
527 | # YOUR OWN EXTERNAL COMMANDS AS DESCRIBED ABOVE, JUST BE CAREFUL WITH THIS. |
---|
528 | # |
---|
529 | # |
---|
530 | # - software : delegates the job's size computation to any |
---|
531 | # external command of your choice. |
---|
532 | # |
---|
533 | # best choice for this is probably to set it |
---|
534 | # this way : |
---|
535 | # |
---|
536 | # accounter: software() |
---|
537 | # |
---|
538 | # which uses pkpgcounter's code internally to compute |
---|
539 | # the size of the job. |
---|
540 | # NB : YOU MUST NOW INSTALL pkpgcounter FOR PyKota TO WORK. |
---|
541 | # |
---|
542 | # You could obtain exactly the same result with : |
---|
543 | # |
---|
544 | # accounter: software(/usr/bin/pkpgcounter) |
---|
545 | # |
---|
546 | # But in this case the job would be passed through |
---|
547 | # pkpgcounter's parser a second time. |
---|
548 | # |
---|
549 | # pkpgcounter is a command line tool which was |
---|
550 | # part of PyKota and which can handle several types |
---|
551 | # of documents. It is now distributed separately. |
---|
552 | # |
---|
553 | # while pkpgcounter is the recommended value if you want |
---|
554 | # to use an external command here, you can use whatever |
---|
555 | # command you want provided your command accepts the job's |
---|
556 | # data on its standard input and prints the job's size in |
---|
557 | # pages as a single integer on its standard output. |
---|
558 | # |
---|
559 | # This value can be set either globally or on a per printer basis |
---|
560 | # If both are defined, the printer option has priority. |
---|
561 | # |
---|
562 | # accounter: hardware(/usr/share/pykota/waitprinter.sh %(printer)s && /usr/bin/snmpget -v1 -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ") |
---|
563 | # accounter: hardware(snmp) |
---|
564 | # accounter: hardware(pjl) |
---|
565 | # accounter: software(/usr/bin/pkpgcounter) |
---|
566 | # |
---|
567 | # The following, software without any argument, works since PyKota 1.21 |
---|
568 | # and uses pkpgcounter's code internally. |
---|
569 | accounter: software() |
---|
570 | |
---|
571 | # What is the "pre"-accounter used for precomputing the job's size. |
---|
572 | # |
---|
573 | # Supported values are : |
---|
574 | # |
---|
575 | # preaccounter: software() |
---|
576 | # preaccounter: software(/path/to/your/script) |
---|
577 | # |
---|
578 | # NB : the preaccounter directive doesn't support hardware() for obvious reasons. |
---|
579 | # If unset, "software()" is assumed. If you use your own script, ensure that it |
---|
580 | # only prints the job's number of pages (or an estimation of it) on its standard output. |
---|
581 | # |
---|
582 | # This value can be set either globally or on a per printer basis |
---|
583 | # If both are defined, the printer option has priority. |
---|
584 | # |
---|
585 | preaccounter: software() |
---|
586 | |
---|
587 | |
---|
588 | # What should we do if the accounter's subprocess doesn't return |
---|
589 | # a valid result (for example doesn't return an integer on its stdout) |
---|
590 | # |
---|
591 | # Valid values are : 'continue' and 'stop'. 'stop' is the default |
---|
592 | # if unset. |
---|
593 | # |
---|
594 | # 'continue' means try to process as usual, this may introduce |
---|
595 | # accounting errors and free jobs. This was the default behavior |
---|
596 | # until v1.20alpha5. |
---|
597 | # |
---|
598 | # 'stop' means fail and stop the print queue. If an accounter |
---|
599 | # error occurs, most of the time this is a misconfiguration, so |
---|
600 | # stopping the print queue is usually the better thing to do |
---|
601 | # until the admin has fixed the configuration. |
---|
602 | # |
---|
603 | # This value can be set either globally or on a per printer basis |
---|
604 | # If both are defined, the printer option has priority. |
---|
605 | # |
---|
606 | # NB : This directive shouldn't do much now because in case |
---|
607 | # of external accounter error, PyKota just loops. |
---|
608 | # |
---|
609 | # onaccountererror: continue |
---|
610 | onaccountererror: stop |
---|
611 | |
---|
612 | # Print Quota administrator |
---|
613 | # These values can be set either globally or per printer or both. |
---|
614 | # If both are defined, the printer option has priority. |
---|
615 | # If these values are not set, the default admin root |
---|
616 | # and the default adminmail root@localhost are used. |
---|
617 | admin: John Doe |
---|
618 | adminmail: root@localhost |
---|
619 | |
---|
620 | # |
---|
621 | # Who should we send an email to in case a quota is reached ? |
---|
622 | # possible values are : DevNull, User, Admin, Both, External(some command) |
---|
623 | # The Both value means that the User and the Admin will receive |
---|
624 | # an email message. |
---|
625 | # The DevNull value means no email message will be sent. |
---|
626 | # This value can be set either globally or per printer or both. |
---|
627 | # If both are defined, the printer option has priority. |
---|
628 | # If the value is not set, then the default BOTH applies. |
---|
629 | # |
---|
630 | # Format of the external syntax : |
---|
631 | # |
---|
632 | # mailto: external(/usr/bin/mycommand >/dev/null) |
---|
633 | # |
---|
634 | # You can use : |
---|
635 | # |
---|
636 | # '%(action)s' will contain either WARN or DENY |
---|
637 | # '%(username)s' will contain the user's name |
---|
638 | # '%(printername)s' will contain the printer's name |
---|
639 | # '%(email)s' will contain the user's email address |
---|
640 | # '%(message)s' will contain the message if you want |
---|
641 | # to use it. |
---|
642 | # |
---|
643 | # On your command line, to pass arguments to your command. |
---|
644 | # Example : |
---|
645 | # |
---|
646 | # mailto: external(/usr/bin/callpager %(username)s "Quota problem on %(printername)s" >/dev/null) |
---|
647 | # |
---|
648 | # To automatically send a WinPopup message (this may only work with a PDC, |
---|
649 | # here the same machine does Samba as PDC + CUPS) : |
---|
650 | # |
---|
651 | # mailto: external(echo "%(message)s" | /usr/bin/iconv --to-code utf-8 --from-code iso-8859-15 | /usr/bin/smbclient -M "%(username)s" 2>&1 >/dev/null) |
---|
652 | # |
---|
653 | # NB : I use ISO-8859-15, but Windows expects UTF-8, so we pipe the message |
---|
654 | # into iconv before sending it to the Windows user. |
---|
655 | # |
---|
656 | # or more simply : |
---|
657 | # |
---|
658 | # mailto: external(/usr/share/pykota/mailandpopup.sh %(username)s %(printername)s "%(email)s" "%(message)s" 2>&1 >/dev/null) |
---|
659 | # |
---|
660 | # NB : The mailandpopup.sh shell script is now included in PyKota |
---|
661 | # |
---|
662 | # NB : in ANY case, don't forget to redirect your command's standard output |
---|
663 | # somewhere (e.g. >/dev/null) so that there's no perturbation to the |
---|
664 | # underlying layer (filter or backend) |
---|
665 | # |
---|
666 | mailto: both |
---|
667 | |
---|
668 | # |
---|
669 | # Grace delay in days |
---|
670 | # This value can be set either globally or per printer or both. |
---|
671 | # If both are defined, the printer option has priority. |
---|
672 | # If the value is not set then the default seven (7) days applies. |
---|
673 | gracedelay: 7 |
---|
674 | |
---|
675 | # |
---|
676 | # Poor man's threshold |
---|
677 | # If account balance reaches below this amount, |
---|
678 | # a warning message is sent by email |
---|
679 | # |
---|
680 | # If unset, default poor man's threshold is 1.0. |
---|
681 | # This option can only appear in the global section |
---|
682 | poorman: 2.0 |
---|
683 | |
---|
684 | # The value of the zero for account balance limitations. |
---|
685 | # If an user his limited by balance, he can print until |
---|
686 | # his balance reaches the value defined here. If unset, |
---|
687 | # the default value is 0. Any floating point value |
---|
688 | # is accepted. |
---|
689 | # |
---|
690 | # This option can only appear in the global section |
---|
691 | # balancezero : -0.25 |
---|
692 | balancezero: 0.0 |
---|
693 | |
---|
694 | # Poor man's warning message |
---|
695 | # The warning message that is sent if the "poorman" value is reached |
---|
696 | # Again this must appear in the global section |
---|
697 | poorwarn: Your Print Quota account balance is low. |
---|
698 | Soon you'll not be allowed to print anymore. |
---|
699 | |
---|
700 | # Soft limit reached warning message |
---|
701 | # The warning message that is sent if the soft quota limit is reached |
---|
702 | # May appear either globally or on a per-printer basis |
---|
703 | softwarn: Your Print Quota Soft Limit is reached. |
---|
704 | This means that you may still be allowed to print for some |
---|
705 | time, but you must contact your administrator to purchase |
---|
706 | more print quota. |
---|
707 | |
---|
708 | # Hard limit reached error message |
---|
709 | # The error message that is sent if the hard quota limit is reached |
---|
710 | # May appear either globally or on a per-printer basis |
---|
711 | hardwarn: Your Print Quota Hard Limit is reached. |
---|
712 | This means that you are not allowed to print anymore. |
---|
713 | Please contact your administrator at root@localhost |
---|
714 | as soon as possible to solve the problem. |
---|
715 | |
---|
716 | # one section per printer, or no other section at all if all options |
---|
717 | # are defined globally. |
---|
718 | # Each section's name must be the same as the printer's queue name as defined |
---|
719 | # in your printing system, be it CUPS or LPRng, between square brackets, for |
---|
720 | # example a print queue named 'hpmarketing' would appear in this file as |
---|
721 | # [hpmarketing] |
---|
722 | |
---|
723 | |
---|
724 | # Default policy to apply when either : |
---|
725 | # |
---|
726 | # - Printer doesn't exist in PyKota's database |
---|
727 | # - User doesn't exist in PyKota's database |
---|
728 | # - User has no quota entry for this Printer in PyKota's database |
---|
729 | # |
---|
730 | # Value can be either allow or deny or external(some command here) |
---|
731 | # |
---|
732 | # This value can be set either globally or per printer or both. |
---|
733 | # If both are defined, the printer option has priority. |
---|
734 | # If the value is not set then the default policy DENY applies. |
---|
735 | # There's no policy wrt inexistant groups, they are ignored. |
---|
736 | # |
---|
737 | # external policy can be used to launch any external command of your choice, |
---|
738 | # for example to automatically add the user to the quota storage |
---|
739 | # if he is unknown. Example : |
---|
740 | # |
---|
741 | # policy: external(/usr/bin/edpykota --add --printer %(printername)s --softlimit 50 --hardlimit 60 %(username)s >/dev/null) |
---|
742 | # |
---|
743 | # NB : If you want to limit users by their account balance value, it is preferable to |
---|
744 | # use the following policy to automate user account creation on first print : |
---|
745 | # |
---|
746 | # policy: external(/usr/bin/autopykota --initbalance 25.0 >/dev/null) |
---|
747 | # |
---|
748 | # This will automatically add the user if he doesn't already exist, and |
---|
749 | # set his initial balance value to 25.0 (for example). If the user already |
---|
750 | # exists then his balance value will not be modified. |
---|
751 | # Please don't use autopykota if you want to limit your users by page |
---|
752 | # quota, and in any case, carefully read autopykota's help or manpage |
---|
753 | # and understand its goal before using it in your own configuration. |
---|
754 | # |
---|
755 | # Of course you can launch any command of your choice with this, e.g. : |
---|
756 | # |
---|
757 | # policy: external(/usr/local/bin/myadminscript.sh %(username)s >/dev/null) |
---|
758 | |
---|
759 | # You can use : |
---|
760 | # |
---|
761 | # '%(username)s' will contain the user's name |
---|
762 | # '%(printername)s' will contain the printer's name |
---|
763 | # |
---|
764 | # On your command line, to pass arguments to your command. |
---|
765 | # |
---|
766 | # NB : Don't forget to redirect your command's standard output somewhere |
---|
767 | # (e.g. >/dev/null) so that there's no perturbation to the underlying |
---|
768 | # layer (filter or backend) |
---|
769 | # |
---|
770 | # If the printer, user, or user quota entry still doesn't exist after |
---|
771 | # external policy command was launched (the external command didn't add it), |
---|
772 | # or if an error occured during the execution of the external policy |
---|
773 | # command, then the job is rejected. |
---|
774 | # |
---|
775 | policy: deny |
---|
776 | |
---|
777 | # Pre and Post Hooks |
---|
778 | # These directives allow the easy plug-in of any command of your choice |
---|
779 | # at different phases of PyKota's execution. |
---|
780 | # Pre and Post Hooks can access some of PyKota's internal information |
---|
781 | # by reading environment variables as described below. |
---|
782 | # The actual phase of PyKota's execution is available in the |
---|
783 | # PYKOTAPHASE environment variable. |
---|
784 | # Pre and Post Hooks can be defined either globally, per printer, |
---|
785 | # or both. If both are defined, the printer specific hook has |
---|
786 | # priority. |
---|
787 | # |
---|
788 | # List of available environment variables : |
---|
789 | # NB : Most of these variables are also available during the execution |
---|
790 | # of external commands defined in the accounter and mailto |
---|
791 | # directives. |
---|
792 | # |
---|
793 | # PYKOTADIRECTORY : The directory containing cupspykota's temporary files |
---|
794 | # PYKOTADATAFILE : The name of the temporary file which contains the |
---|
795 | # job's datas |
---|
796 | # PYKOTAFILENAME : The name of the file which contains the job's datas or |
---|
797 | # empty if datas come from stdin |
---|
798 | # PYKOTACONTROLFILE : The name of the IPP message file |
---|
799 | # PYKOTAMD5SUM : Contains an hexadecimal digest of the md5 sum of the job's datas |
---|
800 | # PYKOTAPHASE : BEFORE or AFTER the job is sent to the printer |
---|
801 | # PYKOTAACTION : ALLOW or DENY or WARN for current print job |
---|
802 | # PYKOTAUSERNAME : user's name |
---|
803 | # PYKOTAPRINTERNAME : printer's name |
---|
804 | # PYKOTAPGROUPS : list of printers groups the current printer is a member of |
---|
805 | # PYKOTAJOBID : job's id |
---|
806 | # PYKOTATITLE : job's title |
---|
807 | # PYKOTACOPIES : number of copies |
---|
808 | # PYKOTAOPTIONS : job's options |
---|
809 | # PYKOTABALANCE : user's account balance |
---|
810 | # PYKOTALIFETIMEPAID : user's grand total paid |
---|
811 | # PYKOTALIMITBY : user print limiting factor, for example 'quota' or 'balance' |
---|
812 | # PYKOTAPAGECOUNTER : user's page counter on this printer |
---|
813 | # PYKOTALIFEPAGECOUNTER : user's life time page counter on this printer |
---|
814 | # PYKOTASOFTLIMIT : user's soft page limit on this printer |
---|
815 | # PYKOTAHARDLIMIT : user's hard page limit on this printer |
---|
816 | # PYKOTADATELIMIT : user's soft to hard limit date limit on this printer |
---|
817 | # PYKOTASTATUS : contains "CANCELLED" when SIGTERM was received by PyKota |
---|
818 | # else is not set. |
---|
819 | # PYKOTAJOBSIZEBYTES : contains the job's size in bytes. Always available. |
---|
820 | # PYKOTAPRECOMPUTEDJOBSIZE : contains the precomputed job's size |
---|
821 | # PYKOTAPRECOMPUTEDJOBPRICE : contains the precomputed job's price |
---|
822 | # PYKOTAJOBORIGINATINGHOSTNAME : contains the client's hostname if |
---|
823 | # it is possible to retrieve it. |
---|
824 | # PYKOTAPRINTERHOSTNAME : the printer's hostname or IP address for network |
---|
825 | # printers, or "localhost" if not defined or not |
---|
826 | # meaningful. |
---|
827 | # PYKOTAWARNCOUNT : the number of times the user was forbidden to print but a banner |
---|
828 | # page was still printed on the current printer. |
---|
829 | # PYKOTAOVERCHARGE : user's overcharging factor. |
---|
830 | # PYKOTAJOBBILLING : Job's billing code if present (CUPS only) |
---|
831 | # PYKOTAREASON : if the job was denied or a warning needs to be issued, contains |
---|
832 | # the message to send to the user. |
---|
833 | # |
---|
834 | |
---|
835 | # PreHook : gets executed after being sure the user, printer and user quota |
---|
836 | # entry on the printer both exist in the PyKota database, and after |
---|
837 | # checking if the user is allowed to print or not, but just before |
---|
838 | # the job is sent to the printer (if allowed) |
---|
839 | # prehook has access to many environment variables : |
---|
840 | # |
---|
841 | # PYKOTAACTION contains either "ALLOW", "WARN" or "DENY" and |
---|
842 | # represents the action which is to be done wrt the print job. |
---|
843 | # PYKOTAPHASE contains 'BEFORE' during execution of prehook |
---|
844 | # |
---|
845 | # uncomment the line below to see what environment variables are available |
---|
846 | # prehook: /usr/bin/printenv >/tmp/before |
---|
847 | |
---|
848 | # PostHook : gets executed after the job has been added to the history. |
---|
849 | # posthook has access to all the environment variables defined above, |
---|
850 | # as well as two additionnal environment variables : PYKOTAJOBPRICE |
---|
851 | # and PYKOTAJOBSIZE. |
---|
852 | # PYKOTAPHASE contains 'AFTER' during execution of posthook. |
---|
853 | # |
---|
854 | # uncomment the line below to see what environment variables are available |
---|
855 | # posthook: /usr/bin/printenv >/tmp/after |
---|
856 | |
---|
857 | # AccountBanner : how should banner accounting be done ? |
---|
858 | # |
---|
859 | # NB : CUPS ONLY FOR NOW ! |
---|
860 | # |
---|
861 | # If enabled, banner pages printed from StartingBanner and/or EndingBanner |
---|
862 | # (depending on the value) will be included in the accounting for the |
---|
863 | # print job |
---|
864 | # |
---|
865 | # If disabled, banner pages printed from StartingBanner and EndingBanner will |
---|
866 | # *not* be included in the accounting for the print job |
---|
867 | # |
---|
868 | # IMPORTANT : CUPS generated banners are ALWAYS accounted for, although you |
---|
869 | # can refund them by using negative prices on printers. |
---|
870 | # |
---|
871 | # Allowed values : Starting | Ending | None | Both |
---|
872 | # |
---|
873 | # - Starting : only the starting banner will be accounted for. |
---|
874 | # - Ending : only the ending banner will be accounted for. |
---|
875 | # - Both : both starting and ending banners will be accounted for. |
---|
876 | # - None : banners will not be accounted for. |
---|
877 | # |
---|
878 | # Default value : |
---|
879 | # accountbanner: Both |
---|
880 | |
---|
881 | # Maximal number of times the banner will still be printed if |
---|
882 | # the user is forbidden to print. |
---|
883 | # |
---|
884 | # NB : CUPS ONLY FOR NOW ! |
---|
885 | # |
---|
886 | # This option can be set either globally or on a per printer basis. |
---|
887 | # Allowed values are 0 or any positive integer. |
---|
888 | # Default value is 0, which means that the banner won't be printed |
---|
889 | # at all if the user is forbidden to print. |
---|
890 | maxdenybanners: 0 |
---|
891 | |
---|
892 | # StartingBanner : if defined will print a banner before the rest of the job |
---|
893 | # is printed. The argument can be a printable file, or an executable file. |
---|
894 | # If not executable, the file will be printed as is. If executable, the |
---|
895 | # file will be executed and its output will be printed. |
---|
896 | # |
---|
897 | # NB : CUPS ONLY FOR NOW ! |
---|
898 | # |
---|
899 | # In any case, the banner content which will be sent to the printer |
---|
900 | # MUST be in a format your printer will accept !!! |
---|
901 | # |
---|
902 | # The pkbanner command included in PyKota can automatically generate |
---|
903 | # starting and ending banners in the PostScript format. You can use |
---|
904 | # this command in a pipe through GhostScript if your printer doesn't |
---|
905 | # accept PostScript as an input format. |
---|
906 | # NB : pkbanner's default page size is A4 |
---|
907 | # |
---|
908 | # startingbanner: /home/joe/mystaticbanner.ps |
---|
909 | # startingbanner: /usr/bin/pkbanner --pagesize=A4 --logo="/home/joe/mylogo.jpeg" --url="http://tech.example.com" |
---|
910 | # startingbanner: /usr/bin/pkbanner | gs -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -sOutputFile=- -sDEVICE=lj5mono - |
---|
911 | # startingbanner: /usr/bin/pkbanner |
---|
912 | |
---|
913 | # EndingBanner : if defined will print a banner after the job |
---|
914 | # has been printed. The argument can be a printable file, or an executable file. |
---|
915 | # If not executable, the file will be printed as is. If executable, the |
---|
916 | # file will be executed and its output will be printed. |
---|
917 | # |
---|
918 | # NB : CUPS ONLY FOR NOW ! |
---|
919 | # |
---|
920 | # In any case, the banner content which will be sent to the printer |
---|
921 | # MUST be in a format your printer will accept !!! |
---|
922 | # |
---|
923 | # The pkbanner command included in PyKota can automatically generate |
---|
924 | # starting and ending banners in the PostScript format. You can use |
---|
925 | # this command in a pipe through GhostScript if your printer doesn't |
---|
926 | # accept PostScript as an input format. |
---|
927 | # NB : pkbanner's default page size is A4 |
---|
928 | # |
---|
929 | # A static banner page |
---|
930 | # endingbanner: /home/joe/mystaticbanner.ps |
---|
931 | # |
---|
932 | # A banner with personnalized logo and url |
---|
933 | # endingbanner: /usr/bin/pkbanner --pagesize=A4 --logo="/home/joe/mylogo.jpeg" --url="http://tech.example.com" |
---|
934 | # |
---|
935 | # A banner in the format accepted by the printer |
---|
936 | # endingbanner: /usr/bin/pkbanner | gs -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -sOutputFile=- -sDEVICE=lj5mono - |
---|
937 | # |
---|
938 | # A banner with more info on it, extracted from the yellow pages. |
---|
939 | # the string "Phone 111222333444" will be added to the banner page |
---|
940 | # if extractphone.sh returns 111222333444 for the current user. |
---|
941 | # endingbanner: /usr/bin/pkbanner Phone `extractphone.sh $PYKOTAUSERNAME` |
---|
942 | # |
---|
943 | # Default PyKota banner |
---|
944 | # endingbanner: /usr/bin/pkbanner |
---|
945 | |
---|
946 | # How should enforcement be done for this printer ? |
---|
947 | # |
---|
948 | # "laxist" is the default if value is not set, and allows users |
---|
949 | # to be over quota on their last job. |
---|
950 | # |
---|
951 | # "strict" tries to prevent users from ever being over quota. |
---|
952 | # |
---|
953 | # Enforcement can be defined either globally, per printer, |
---|
954 | # or both. If both are defined, the printer specific enforcement |
---|
955 | # setting has priority. |
---|
956 | # |
---|
957 | # valid values : "strict" or "laxist" |
---|
958 | # |
---|
959 | # default value |
---|
960 | # enforcement : laxist |
---|
961 | enforcement : strict |
---|
962 | |
---|
963 | # Should we trust the job size on this printer ? |
---|
964 | # |
---|
965 | # "trustjobsize : yes" is the default, the jobsize, either computed |
---|
966 | # by the hardware or by software is trusted. |
---|
967 | # |
---|
968 | # "trustjobsize : >N:precomputed" : uses the precomputed value if jobsize > N pages |
---|
969 | # "trustjobsize : >N:25" : uses 25 if jobsize is >N pages |
---|
970 | # |
---|
971 | # General form : ">n:m" where n is a positive integer, and m is |
---|
972 | # either the word 'precomputed' or a positive integer. |
---|
973 | # The special form "yes" is also accepted and is the default. |
---|
974 | # |
---|
975 | # This directive can be set either globally or on a per printer |
---|
976 | # basis. Use this directive when hardware accounting for a particular |
---|
977 | # printer produces some glitches due to the printer returning |
---|
978 | # incorrect answers. |
---|
979 | # |
---|
980 | # NB : DON'T MODIFY THIS IF YOU DON'T NEED TO. THIS IS ONLY TO BE USED |
---|
981 | # AS A WORKAROUND FOR SOME PRINTERS. IT'S PROBABLY BETTER TO ALWAYS |
---|
982 | # SET THIS DIRECTIVE TO 'yes'. THIS DIRECTIVE WILL ONLY BE HONORED |
---|
983 | # IF PYKOTA DETECTS A DIFFERENCE BETWEEN THE PRECOMPUTED JOB SIZE |
---|
984 | # AND THE JOB SIZE AS COMPUTED BY PYKOTA EITHER USING HARDWARE OR |
---|
985 | # SOFTWARE. |
---|
986 | trustjobsize : yes |
---|
987 | |
---|
988 | # Should we deny duplicate jobs ? |
---|
989 | # |
---|
990 | # A duplicate is a job sent twice (or more) in a row to the same printer |
---|
991 | # by the same user. |
---|
992 | # |
---|
993 | # This can be defined either globally or on a per printer basis |
---|
994 | # The default value is 'no', meaning that duplicate jobs are |
---|
995 | # allowed. |
---|
996 | # |
---|
997 | # NB : if an user prints a job, a second user prints another |
---|
998 | # job, and the first user prints the first job again, |
---|
999 | # this is NOT considered as a duplicate since the two |
---|
1000 | # identical jobs printed by the first user are not |
---|
1001 | # one just after the other. |
---|
1002 | # |
---|
1003 | # Possible values are 'yes', 'no', or any other string. |
---|
1004 | # If the string is not recognized as a truth value, |
---|
1005 | # it is considered to be a command to launch. |
---|
1006 | # PyKota launches the command and parses its standard |
---|
1007 | # output. The special keywords 'ALLOW' and 'DENY' are |
---|
1008 | # recognized, allowing an external tool to decide if |
---|
1009 | # the job is to be allowed or denied. |
---|
1010 | # |
---|
1011 | # denyduplicates : /usr/bin/myowncommand with some arguments |
---|
1012 | # denyduplicates : yes |
---|
1013 | denyduplicates : no |
---|
1014 | |
---|
1015 | # Sets the delay in seconds after which two identical jobs are |
---|
1016 | # not considered as being a duplicate. |
---|
1017 | # |
---|
1018 | # This can be defined either globally or on a per printer basis |
---|
1019 | # The default value if not set is 0, for 0 seconds. |
---|
1020 | # duplicatesdelay : 300 |
---|
1021 | duplicatesdelay : 0 |
---|