root / pykota / trunk / conf / pykota.conf.sample @ 3180

Revision 3180, 50.5 kB (checked in by jerome, 17 years ago)

Now the various delays are configurable when using hardware accounting,
through the newly introduced 'statusstabilizationdelay' and 'statusstabilizationloops'
directives in pykota.conf

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
RevLine 
[695]1# PyKota sample configuration file
2#
3#
[2204]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#
[952]28# PyKota - Print Quotas for CUPS and LPRng
[695]29#
[3133]30# (c) 2003, 2004, 2005, 2006, 2007 Jerome Alet <alet@librelogiciel.com>
[873]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.
[695]35#
[873]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
[2303]43# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
[695]44#
45# $Id$
46#
47
[2837]48
49#
50# All directives must be placed below the following line
[695]51[global]
[859]52
[2837]53
54
[2593]55####################################################################
56# SQLite3 : comment this section out if you use another backend    #
57####################################################################
58
59#storagebackend : sqlitestorage
60#storagename: /etc/pykota/pykota.db
61
[2837]62####################################################################
63
64
65
[2638]66############################################################################
67# PostgreSQL or MySQL: comment this section out if you use another backend #
68############################################################################
[1021]69storagebackend: pgstorage
[2638]70# storagebackend: mysqlstorage
[1021]71
[952]72# Quota Storage Server hostname (and optional port)
[2875]73# e.g. db.example.com:5432 (for PostgreSQL) or db.example.com:3306 (for MySQL)
74# NB : leave the directive empty to use unix sockets (same host only)
[695]75storageserver: localhost
[859]76
77#
78# name of the Quota Storage Database
[695]79storagename: pykota
[859]80
[1087]81#
82# Quota Storage normal user's name and password
83# These two fields contain a username and optional password
84# which may give readonly access to your print quota database.
85#
86# PLEASE ENSURE THAT THIS USER CAN'T WRITE TO YOUR PRINT QUOTA
87# DATABASE, OTHERWISE ANY USER WHO COULD READ THIS CONFIGURATION
88# FILE COULD CHANGE HIS PRINT QUOTA.
89#
[2819]90storageuser : pykotauser
91# In the line below change the password's value if needed.
92storageuserpw : readonlypw
[695]93
[2837]94############################################################################
95
96
97
[2593]98####################################################################
99# LDAP : comment this section out if you use another backend       #
100####################################################################
[1038]101# LDAP example, uncomment and adapt it to your own configuration :
[2838]102#
[1016]103#storagebackend: ldapstorage
[2355]104#storageserver: ldap://ldap.example.com:389
105#storagename: dc=example,dc=com
[2576]106#
107# NB : the user and password below are the ones contained in
108# the sample LDIF file pykota/initscripts/ldap/pykota-sample.ldif
109# Please adapt these lines to your own needs.
[2838]110#
[2576]111#storageuser: cn=pykotauser,dc=example,dc=com
112#storageuserpw: ls88DT5j
[2838]113
114
115
[1968]116# TLS support for LDAP
117#
118# ldaptls can be set to either Yes or No
119# the default value when not set is No, meaning that TLS won't be used.
[2838]120#
[1968]121#ldaptls: No
122#
123# cacert points to the CA Certificate file to use for TLS.
124# Ensure that every user who can launch PyKota commands can read this file.
125# There's NO default value for this directive.
[2838]126#
[2442]127#cacert: /etc/pykota/mycertfile
[2838]128
129
130
[1025]131# Here we define some helpers to know where
132# to plug into an existing LDAP directory
[2838]133# NB : THE DIRECTIVES BELOW MUST BE PRESENT WITH AN LDAP BACKEND
134# BUT YOU ARE FREE TO CHANGE THE VALUES.
135#
[2355]136#userbase: ou=People,dc=example,dc=com
[1025]137#userrdn: uid
[2355]138#balancebase: ou=People,dc=example,dc=com
[1038]139#balancerdn: uid
[2355]140#groupbase: ou=Groups,dc=example,dc=com
[1025]141#grouprdn: cn
[2355]142#printerbase: ou=Printers,ou=PyKota,dc=example,dc=com
[1025]143#printerrdn: cn
[2355]144#jobbase: ou=Jobs,ou=PyKota,dc=example,dc=com
145#lastjobbase: ou=LastJobs,ou=PyKota,dc=example,dc=com
146#billingcodebase: ou=BillingCodes,ou=PyKota,dc=example,dc=com
[1969]147
148# These two fields are special, they either accept a branch
149# dn, like an ou for example, or the special keywords 'user'
150# and 'group'. If 'user' or 'group' is used, the print quota
151# entries will be created below the user or group entry itself,
152# which will then be used like a branch (you can mix and match
153# different values depending on what you want to do).
[2838]154#
155# NB : YOU MUST CHOOSE A VALUE FOR USERQUOTABASE AND A VALUE
156# FOR GROUPQUOTABASE, BUT ONLY ONE LINE OF EACH MUST BE PRESENT.
[1969]157#userquotabase: user
[2355]158#userquotabase: ou=UQuotas,ou=PyKota,dc=example,dc=com
[1969]159#groupquotabase: group
[2355]160#groupquotabase: ou=GQuotas,ou=PyKota,dc=example,dc=com
[1969]161
[2838]162
163
[1105]164# How to create new accounts and groups
[1510]165# authorized values are "below" and "attach(objectclass name [, fail|warn])"
[1105]166#
167# "below" creates the new accounts/groups as standalone entries
168# below the above defined 'userbase' ou
[1029]169#
[1510]170# attach(objectclass name [, action]) tries to find some existing user/group
[1105]171# using the above defined 'userrdn' or 'grouprdn' and 'userbase'
172# 'groupbase', and attach the PyKota specific entries to it.
[1510]173# if action is "warn" and no entry exists to attach to, a new
174# entry is created, and a message is logged.
175# if action is "fail" and no entry exists to attach to, program
176# logs an error message and aborts.
177# if action is not set, the default value is "fail".
[1105]178#
[1510]179# a possible value:  newuser: attach(posixAccount, warn)
[2838]180#
[1114]181#newuser : below
182#newgroup : below
[2838]183
184
185
[1111]186# LDAP attribute which stores the user's email address
[2837]187#
[1114]188#usermail : mail
[1105]189
[2838]190
191
[1029]192# Choose what attribute contains the list of group members
193# common values are : memberUid, uniqueMember, member
[2837]194#
[1029]195#groupmembers: memberUid
[1016]196
[2838]197
198
[1356]199# Activate low-level LDAP cache yes/no
200# Nothing to do with "storagecaching" which is higher level
201# and database independant.
[1357]202# This saves some search queries and may help with heavily
203# loaded LDAP servers.
204# This is EXPERIMENTAL.
[1368]205#
206# BEWARE : SETTING THIS TO 'YES' CAUSES PROBLEMS FOR NOW
207# BETTER TO LET IT SET TO 'NO'
[2837]208#
[1604]209# ldapcache: no
[1356]210
[2837]211####################################################################
212
[2593]213#############################################################
[2837]214# END of database specific directives                       #
[2593]215#############################################################
216
[2837]217
218
[2593]219# Should the database caching mechanism be enabled or not ?
220# If unset, caching is disabled. Possible values Y/N/YES/NO
[2777]221# caching mechanism works with both relationnal and OpenLDAP backends
[2593]222# but may be really interesting only with OpenLDAP.
223#
224# ACTIVATING CACHE MAY CAUSE PRECISION PROBLEMS IN PRINT ACCOUNTING
225# IF AN USER PRINTS ON SEVERAL PRINTERS AT THE SAME TIME.
226# YOU MAY FIND IT INTERESTING ANYWAY, ESPECIALLY FOR LDAP.
227#
[2777]228# THERE'S NO GUARANTEE THAT THIS CACHING MECHANISM WILL IMPROVE
229# PERFORMANCE WITH RELATIONNAL BACKENDS. IT MIGHT EVEN MAKE
230# PERFORMANCE DECREASE. AS ALWAYS : YMMV.
231#
[2593]232# FYI, I ALWAYS SET IT TO YES !
233#
234storagecaching: No
235
[2837]236
237
[2593]238# Should full job history be disabled ?
239# If unset or set to No, full job history is kept in the database.
240# Disabling the job history can be useful with heavily loaded
241# LDAP servers, to not make the LDAP tree grow out of control.
[2777]242# Disabling the job history with a relationnal backend works too
[2593]243# but it's probably less useful than with LDAP.
[2837]244#
[2593]245disablehistory: No
246
[2837]247
248
[2876]249# Where to log ?
[2837]250# supported values : stderr, system (system means syslog, but don't use
251# 'syslog' here). if the value is not set then the default SYSTEM applies.
252#
[782]253logger: system
[695]254
[2837]255
256
[1186]257# Enable debugging ? Put YES or NO there.
[2681]258# debug is set to YES in this sample configuration file, so debugging
259# is activated when configuring PyKota, which helps a lot. After all
260# works, just put NO instead to save some disk space in your logs.
261# NB : When set to YES, there is a very significant impact on performance
262# when managing many users, printers or billing codes at once, because
263# hundreds of thousands of log lines can be generated.
264# When printing a job, typically around 250-300 log lines are generated,
265# so the impact per job is really minimal. Note however that this will
266# add up over a large number of jobs.
[2837]267#
[1240]268debug : Yes
[1021]269
[2837]270
271
[2262]272# The URL to PyKota's logo when used from the CGI scripts.
273# You can use your own logo by modifying the URL below.
274# If not defined, the default URL is the same as the
[2837]275# one defined below :
276#
[2900]277logourl : http://www.pykota.com/pykota.png
[2262]278
[2837]279
280
[2265]281# The destination to which the web browser will be redirected
282# when you click on the logo defined above.
283# If not defined, the default URL is the same as the
[2837]284# one defined below :
285#
[2900]286logolink : http://www.pykota.com/
[2265]287
[2837]288
289
[695]290# Mail server to use to warn users
[853]291# If the value is not set then localhost is used.
[2837]292#
[695]293smtpserver: localhost
[806]294
[2837]295
296
[1517]297# Crash messages' recipient : in addition to the log files
298# each software crash can be sent to the author of PyKota
299# or any other person of your choice. By default this
[2837]300# is disabled for privacy concerns (see below). The address
301# pykotacrashed@librelogiciel.com reaches PyKota's author.
[1517]302# The 'adminmail' (defined a bit below) is CCed.
303#
304# Privacy concerns : what is sent is only :
305#
306#        - a copy of the software's traceback
307#        - a copy of the software's command line arguments
308#        - a copy of the software's environment variables
309#
[2837]310# suggested value :
311#
[1517]312# crashrecipient: pykotacrashed@librelogiciel.com
313
[2837]314
315
[1353]316# Email domain
317# If the value is not set, and the mail attribute for the user
318# is not set in the PyKota storage, be it LDAP (see usermail directive
[2777]319# above) or a relationnal one, then email messages are sent to
[1353]320# username@smtpserver
321#
322# If the value is set, then email messages are sent to
323# username@maildomain using the SMTP server defined above
324#
325# Set the appropriate value below, example.com set as per RFC2606.
[2837]326#
[1353]327maildomain: example.com
328
[2837]329
330
[3169]331# Should we modify usernames when printing ?
332# Default is native, meaning usernames won't be modified.
[2837]333# This is a [global] option only.
[3169]334# Some people reported that WinXP sends mixed case usernames,
335# setting usernamecase to 'upper' or 'lower' solves the problem.
336# Of course you have to use uppercase or lowercase only when managing
337# users with pkusers, because ALL database accesses are
[1227]338# still case sensitive.
339#
[3169]340# If usernamecase is 'upper' or 'lower', the usernames received
341# from the printing system are converted to uppercase or lowercase,
342# respectively, at the start of printing, BUT ONLY when printing.
[1227]343#
[3169]344# If usernamecase is 'native', which is the default, strict case checking
[1227]345# is done, this means that users 'Jerome' and 'jerome' are
346# different. Printer and groups names are ALWAYS case sensitive.
[2837]347#
[3169]348# usernamecase : upper
349# usernamecase : lower
350usernamecase: native
[1227]351
[2837]352
353
[1757]354# Should we split usernames on a specific separator when printing ?
355# Default is No, i.e. if the value is unset.
[2837]356# This is a [global] option only.
[1757]357# This option adds support for Samba's Winbind utility, which
358# prefixes usernames with domain name and separator character.
359# Of course if you set this then you have to use NO separator when
360# adding users with edpykota.
361#
362# If winbind_separator is set, the usernames received from the printing
363# system are split on the separator's value, and only the last part
364# (real username) is used.
365#
366# If winbind_separator is not set, which is the default, strict
367# username equality checking will be done (modulo the setting
368# of the 'utolower' directive), this means that users 'DOMAIN1/jerome',
369# 'Domain2/jerome' and 'jerome' are different.
[2837]370#
[1757]371# winbind_separator: /
372
[2837]373
374
[1956]375# When creating users or groups accounts, should we reject users
376# or groups which are unknown from the system ?
377# The default if unset is NO. This means that by default, you
378# can create users or groups for which `getent passwd username`
379# or `getent group groupname` returns nothing.
380#
381# Allowed values : Yes | No
382# Default value : No
383#
384# reject_unknown: No
385
[2837]386
387
[1875]388# Do we want to hide jobs' title, filename and options for privacy
389# reasons ?
390# This may be required in some countries (Italy comes to mind).
391# Allowed values are YES and NO.
392# If unset, the default value is NO, meaning that jobs' title, filename
393# and options will be saved into the history.
394# This option can't be set on a per printer basis, only into the
395# [global] section.
[2837]396#
[1875]397privacy : no
398
[2837]399
400
[2583]401# When the real CUPS backend fail, should we modify the
402# user's page counters and account balance or not ?
[2759]403# Also should we retry and if yes then how often and how many times ?
[2583]404# If you trust your users, set it to "nocharge".
405# If you think they found some mean to kill the real CUPS backend,
406# then set it to "charge".
[2759]407# If your print queues get regularly disabled by CUPS when the printers
408# are switched off, you might want to set it to "retry:N:S" where
409# N is the number of times the operation should be retried, and S is
410# the delay in seconds during which PyKota will sleep before trying again.
[2764]411# This 'retry' feature works in a way similar to Till Kamppeter's beh
412# backend wrapper which offers this functionnality but is actually not
413# compatible with PyKota (because of my own inability to master regular
414# expressions).
[2759]415# If N is 0, PyKota will retry indefinitely each S seconds until the
416# backend succeeds, so you should use this with caution. If N is 0,
417# of course neither "charge" nor "nocharge" will be honored.
418# You can combine "charge" or "nocharge" with "retry:N:S" if you want,
419# by separating the values with a comma as shown in the examples below.
[2583]420# If unset, the default value is "nocharge", meaning that users won't be
421# charged whenever a CUPS backend fails. This is the OPPOSITE
422# behavior compared to PyKota versions prior to 1.24alpha2.
423# This value can be set either globally or on a per printer basis
424# If both are defined, the printer option has priority.
[2837]425#
[2759]426# onbackenderror : charge,retry:5:60
427# onbackenderror : retry:0:300
428# onbackenderror : retry:3:300,nocharge
[2583]429# onbackenderror : charge
430onbackenderror : nocharge
431
[2837]432
433
[2307]434# Should we strip off some characters from the beginning of
435# print jobs' titles ? This can be used to remove smbprn.??????
436# which sometimes appear when printing in raw mode from Windows
437# through Samba.
438# This setting only applies at printing time.
439# When not set, titles are used as received from the printing system.
440# The default is to not strip any character off of jobs' titles.
441# This value can be set either globally or on a per printer basis
442# If both are defined, the printer option has priority.
[2837]443#
[2307]444# striptitle : smbprn.??????
445
[2837]446
447
[2385]448# Should we launch a command to overwrite the job's ticket ?
449# This allows a command to overwrite the username and/or the
[2631]450# billing code used, or to deny or cancel the job.
[2385]451# If unset no command is launched and the job's username and
452# billing code are used as they are received.
453# To overwrite the job's ticket, the command has to print
454# on its standard output one or more of the following lines,
455# without any prefix or space character :
456#
457#    USERNAME=the_username_we_want_to_overwrite_with
458#    BILLINGCODE=the_billingcode_we_want_to_overwrite_with
[3146]459#    REASON=reason_we_chose_deny_or_cancel
[2803]460#    AUTH=NO (equivalent to DENY below)
[2392]461#    DENY
[2631]462#    CANCEL
[2385]463#
[2895]464# NB : the output of your command is entirely read, and the latest
465# value seen is used, so you command can output several usernames
[2385]466# or billing codes and only the latest ones will be used.
467# If only USERNAME= lines are printed, the billing code,
468# if any, is used unchanged.
469# If only BILLINGCODE= lines are printed, the username is
470# used unchanged.
[2930]471# If DENY or CANCEL is output, neither the username nor the
[3146]472# billing code can be overwritten.
473# If REASON is output, that will be used in the notification in the case of
474# DENY or CANCEL. Otherwise, the built-in reasons will be used.
[2385]475#
476# This value can be set either globally or on a per printer basis
477# If both are defined, the printer option has priority.
478#
[2965]479#�IMPORTANT :
480#
481#       If you use this directive to interact with the end user in
482#       some way, for example through pknotify+pykoticon or similar
483#       tools, you have to keep in mind that this directive, as all
484#       the directives in pykota*.conf, is processed at the time
485#       the print job reaches the top of the print queue, and not
486#       at the time it enters the print queue. For heavily loaded
487#       systems where several jobs are in the print queue at a given
488#       time, there may be a significant delay between the moment the
489#       user submits the print job, and the moment this directive is
490#       processed.
491#
[2837]492# examples :
493#
[2930]494# overwrite_jobticket : /usr/bin/pknotify --destination $PYKOTAJOBORIGINATINGHOSTNAME:7654 --timeout 180 --denyafter 3 --checkauth --ask "Username:username:$PYKOTAUSERNAME" "Password:password:" "Billing code:billingcode:$PYKOTAJOBBILLING"
[2385]495# overwrite_jobticket : /path/to/some/script/or/command
496
[2837]497
498
[2895]499# Should we ask the end user for a confirmation about their print job ?
500#
501# Any script can be launched here. If your script prints CANCEL on
502# its standard output, the job is cancelled, else processing of the
503# job continues to next step.
504#
505# NB : the output of your command is read until CANCEL is found
506# or all lines have been read.
507#
508# This value can be set either globally or on a per printer basis
509# If both are defined, the printer option has priority.
510#
511# examples :
512#
513# askconfirmation : /usr/bin/pknotify --destination $PYKOTAJOBORIGINATINGHOSTNAME:7654 --timeout 120 --confirm "Hello $PYKOTAUSERNAME.\nPrint job $PYKOTAJOBID send to printer $PYKOTAPRINTERNAME is $PYKOTAPRECOMPUTEDJOBSIZE pages long\nand will cost you $PYKOTAPRECOMPUTEDJOBPRICE credits.\n\nYou currently have $PYKOTABALANCE credits.\n\nDo you really want to print ?"
514
515
516
[2385]517# What should we do when we print and the billing code used is
518# not present in the database ?
519# The default value is 'create' which adds the billing code to the
520# database.
521# Other values can be :
522#       deny
523#     which silently rejects the job.
524# or :
525#       deny(your script here)
526#     if you put the path to a script or command here, it is executed, for
527#     example you can open a popup window explaining why the job was
528#     rejected.
529#
530# This value can be set either globally or on a per printer basis
531# If both are defined, the printer option has priority.
532#
[2631]533# unknown_billingcode : deny
[2837]534# unknown_billingcode : deny(/usr/bin/pknotify --destination $PYKOTAJOBORIGINATINGHOSTNAME:7654 --timeout 60 --notify "The billing code specified is not allowed")
[2631]535# unknown_billingcode : deny(/path/to/some/script)
[2385]536# unknown_billingcode : create
537
[2837]538
539
[2405]540# Where should we store our (temporary) files when printing ?
541# if unset, defaults to a system directory dedicated to temporary
542# files and evaluated at runtime (see Python's documentation
543# for the tempfile.gettempdir() function).
544# This value can be set either globally or on a per printer basis
545# If both are defined, the printer option has priority.
[2406]546# On my system, when not set, the /var/spool/cups/tmp directory is used.
[2405]547# directory : /tmp
548# directory : /var/spool/cups
549
[2837]550
551
[2405]552# Should we keep our work files on disk after printing ?
553# If unset, temporary files are deleted once the work is finished.
554# If set to yes, files are kept on disk in the 'directory'
555# named with the previous directive.
556# This value can be set either globally or on a per printer basis
557# If both are defined, the printer option has priority.
558# Default value is No, meaning temporary files are deleted
[2837]559# You should set it to yes only during installation to not
560# waste disk space during normal use.
561#
[2405]562# keepfiles : yes
563keepfiles : no
564
565
[2837]566
567# What is the accounting backend to use : this defines the way PyKota
568# will compute the number of pages printed. This directive is the most
569# important one in PyKota's configuration.
[974]570#
[2837]571# NB : This directive is MANDATORY, there's no default value when not set.
[974]572#
[2837]573# Supported values :
[976]574#
[2837]575# - software([/path/to/some/script[ --with-args]])
576# - hardware(snmp[:community]|pjl[:port]|/path/to/some/script[ --with-args])
[1483]577#
[2837]578# Hardware asks the printer for its lifetime page counter through either
579# SNMP, PJL-over-TCP, or through any command of your choice. This is
580# the recommended way to use PyKota, although it might not work with some
581# printers. The page counter is asked twice per job : before the job
582# is sent to the printer, and after it has been entirely sent.
583# The big advantages of hardware accounting are lighter CPU usage compared
584# to software accounting described below, although it can take more time
585# because of necessary internal counter stabilization delays, and the fact
586# that paper jams don't cause users to be charged for pages they couldn't
587# print.
588# For hardware accounting, two special values are accepted in addition
589# to a script name : snmp and pjl. 'snmp' asks PyKota to use its internal
590# SNMP code, 'pjl' asks PyKota to internally send a specially crafter PJL
591# job to the printer's TCP port 9100 (by default).
[1746]592#
[2837]593# Software counts pages by parsing the print job's datas, either internally
594# when no script is specified, or through any script of your choice.
595# This works with ALL printers, provided you've got a script to parse
596# datas produced by your printer driver. PyKota's internal parser, also
597# available under the name 'pkpgcounter', recognizes several page description
598# languages, but may occasionally fail for some printer drivers.
599# You can however use any other command, provided it can read the datas to
600# parse from its standard input, and prints a single integer on its standard
601# output, representing the number of pages in the print job.
602# Software accounting unfortunately may overcharge users in case of paper
603# jams.
[3036]604#
605# Ink computes the price of a print job by parsing the job's datas
606# through pkpgcounter, and using the percents of ink coverage returned
607# for each color in the specified colorspace.
608
609# Supported colorspaces for ink accounting currently are :
610#
611#       bw      ===> Black & White
612#       cmyk    ===> Cyan, Magenta, Yellow, Black
613#       cmy     ===> Cyan, Magenta, Yellow
614#       rgb     ===> Red, Green, Blue
[3122]615#       gc      ===> Grayscale, Colored : this is a pseudo colorspace useful
616#                    if all you need is differentiating grayscale from
617#                    colored pages.
[3036]618#
619# Supported resolutions for ink accounting are any number of dots
620# per inch comprised between 72 and 1200.
621# IMPORTANT : increasing the resolution increases precision, but
622# increase CPU load a lot at the same time. The default resolution
623# if unset is 72, for 72 dpi.
[3044]624# If you want to use ink accounting, you have to define a set of
625# coefficients for each color in the colorspace, as explained
626# further below in this file.
[1746]627#
[2837]628# You can get hints on which configuration is best for your printers by
629# typing : pkturnkey --doconf
[1746]630#
[2837]631# In the lines below "%(printer)s" is automatically replaced at run time
632# with your printer's Fully Qualified Domain Name for network printers,
633# if PyKota can extract it from its environment.
[2425]634#
[2837]635# Examples :
[2425]636#
[2837]637# accounter : hardware(snmp)
638# accounter : hardware(snmp:private)
639# accounter : hardware(pjl)
640# accounter : hardware(pjl:9101)
641# 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 " ")
642# accounter : hardware(/usr/bin/npadmin --pagecount %(printer)s)
643# 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)
644# accounter : hardware(/bin/cat /usr/share/pykota/pagecount.pjl >/dev/lp0 && /usr/bin/head -2 </dev/lp0 | /usr/bin/tail -1)
645# 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)
646# 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)
647# accounter : software(/usr/bin/pkpgcounter)
648# accounter : software()
[3036]649# accounter : ink(cmyk, 150)
650# accounter : ink(bw, 300)
651# accounter : ink(bw)
652# accounter : ink(cmy, 72)
[3122]653# accounter : ink(gc, 72)
[1483]654#         
[2837]655# This directive can be set either globally or per printer or both.
656# If both are defined, the printer option has priority.
[1483]657#         
[2837]658# IF YOU PLAN TO USE YOUR OWN SCRIPTS FOR HARDWARE ACCOUNTING,     
659# YOU ABSOLUTELY HAVE TO BE SURE YOU HAVE A SCRIPT WHICH WAITS FOR THE
660# PRINTER BEING READY BEFORE ASKING FOR ITS INTERNAL PAGE COUNTER.
[1483]661#         
[2837]662# PYKOTA'S 'snmp' and 'pjl' HARDWARE ACCOUNTING METHODS DO THE CORRECT WORK
663# INTERNALLY, BUT SOME OF THE EXAMPLES ABOVE DON'T, YOU HAVE BEEN WARNED.
[1587]664#
[2837]665# WITH THE SPECIAL MAGIC hardware(snmp) AND hardware(pjl) VALUES, PYKOTA
666# TAKES CARE OF ALL THIS FOR YOU, SO PLEASE UNDERSTAND THAT IT IS PREFERABLE
667# TO USE THESE TWO METHODS : THEY WORK FINE, REQUIRE LITTLE TO NO CPU,
668# AND DO ALL THE HARD WORK AUTOMATICALLY. IF YOU REALLY NEED TO YOU CAN USE
669# YOUR OWN EXTERNAL COMMANDS AS DESCRIBED ABOVE, JUST BE CAREFUL WITH THIS.
[1483]670#         
[2837]671# Sane default :
[1483]672#
[2074]673accounter: software()
[806]674
[3162]675# Should we ensure that the printer really is idle before
676# sending the job's datas to it ?
677#
678# This directive is only used when you use an internal
679#�hardware accounting mechanism, like hardware(snmp) or
680# hardware(pjl), and is not used for external hardware
681# accounting mechanisms or for software or ink accounting.
682#
683# If PyKota and CUPS are properly configured, i.e. a single
684# computer (the print server) can access to a particular physical
685# printer, or all CUPS+PyKota print servers which access to the
686# same physical printer share a common network directory used
687# by PyKota to lock this printer resource, then it is not necessary
688# to really ensure the printer is idle before the job, because
689# this is already the case : we already wait at the end of the
690# preceding job for the printer to be idle before reading its
691# internal page counter. So setting this value to Yes usually
692# saves a lot of time between jobs, generally around 30 seconds.
693#
694# If you're not sure, leave this value to the default which is No,
695# meaning that before sending the job's datas to the printer, PyKota
696# will ensure this printer is in idle state.
697#
698# If not defined, a value of No is assumed.
699#
700# This value can be set either globally or on a per printer basis
701# If both are defined, the printer option has priority.
702#
703# Sane default :
704#
705skipinitialwait : no
[2837]706
[2635]707# What is the "pre"-accounter used for precomputing the job's size.
708#
709# Supported values are :
710#
711#  preaccounter: software()       
712#  preaccounter: software(/path/to/your/script)
[3036]713#  preaccounter: ink(colorspace, resolution)
[2635]714#
[2837]715# NB : the preaccounter directive doesn't support hardware() for obvious
716# reasons. If unset, "software()" is assumed. If you use your own script,
717# ensure that it only prints the job's number of pages (or an estimation
718# of it) on its standard output.
[2635]719#
[2837]720# You may want to define for example 'preaccounter : software(/bin/echo 1)'
721# in the case your printer supports an hardware accounter but pkpgcounter
722# can't parse your printer driver's datas.
723#
[3036]724# Supported colorspaces for ink accounting currently are :
725#
726#       bw      ===> Black & White
727#       cmyk    ===> Cyan, Magenta, Yellow, Black
728#       cmy     ===> Cyan, Magenta, Yellow
729#       rgb     ===> Red, Green, Blue
[3122]730#       gc      ===> Grayscale, Colored : this is a pseudo colorspace useful
731#                    if all you need is differentiating grayscale from
732#                    colored pages.
[3036]733#
734# Supported resolutions for ink accounting are any number of dots
735# per inch comprised between 72 and 1200.
736# IMPORTANT : increasing the resolution increases precision, but
737# increase CPU load a lot at the same time. The default resolution
738# if unset is 72, for 72 dpi.
739#
[2635]740# This value can be set either globally or on a per printer basis
741# If both are defined, the printer option has priority.
742#
[2837]743# Sane default :
744#
[2635]745preaccounter: software()
746
747
[2837]748
[1687]749# What should we do if the accounter's subprocess doesn't return
750# a valid result (for example doesn't return an integer on its stdout)
751#
752# Valid values are : 'continue' and 'stop'. 'stop' is the default
753# if unset.
754#
755# 'continue' means try to process as usual, this may introduce
756# accounting errors and free jobs. This was the default behavior
757# until v1.20alpha5.
758#
759# 'stop' means fail and stop the print queue. If an accounter
760# error occurs, most of the time this is a misconfiguration, so
761# stopping the print queue is usually the better thing to do
762# until the admin has fixed the configuration.
763#
764# This value can be set either globally or on a per printer basis
765# If both are defined, the printer option has priority.
766#
[1826]767# NB : This directive shouldn't do much now because in case
768# of external accounter error, PyKota just loops.
769#
[1687]770# onaccountererror: continue
771onaccountererror: stop
772
[2837]773
774
[806]775# Print Quota administrator
776# These values can be set either globally or per printer or both.
777# If both are defined, the printer option has priority.
[853]778# If these values are not set, the default admin root
779# and the default adminmail root@localhost are used.
[1186]780admin: John Doe
781adminmail: root@localhost
[806]782
[2837]783
784
[852]785# Who should we send an email to in case a quota is reached ?
[1192]786# possible values are : DevNull, User, Admin, Both, External(some command)
[852]787# The Both value means that the User and the Admin will receive
788# an email message.
789# The DevNull value means no email message will be sent.
790# This value can be set either globally or per printer or both.
791# If both are defined, the printer option has priority.
[853]792# If the value is not set, then the default BOTH applies.
[1192]793#
[1231]794#   Format of the external syntax :
[1192]795#
[1231]796#       mailto: external(/usr/bin/mycommand >/dev/null)
797#
[1192]798#   You can use :
799#
800#       '%(action)s'            will contain either WARN or DENY
801#       '%(username)s'          will contain the user's name
802#       '%(printername)s'       will contain the printer's name
803#       '%(email)s'             will contain the user's email address
804#       '%(message)s'           will contain the message if you want
[1230]805#                               to use it.
[1192]806#
[2837]807#   on your command line, to pass arguments to your command.
808#   Examples :
[1192]809#
[2837]810#     mailto: external(/usr/bin/callpager %(username)s "Quota problem on %(printername)s" >/dev/null)
[1192]811#
[1233]812#   To automatically send a WinPopup message (this may only work with a PDC,
813#   here the same machine does Samba as PDC + CUPS) :
[1231]814#
[2837]815#     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)
[1231]816#
[1233]817#   NB : I use ISO-8859-15, but Windows expects UTF-8, so we pipe the message
818#        into iconv before sending it to the Windows user.
[1193]819#
[1240]820# or more simply :
821#
[2837]822#     mailto: external(/usr/share/pykota/mailandpopup.sh %(username)s %(printername)s "%(email)s" "%(message)s" 2>&1 >/dev/null)
[1240]823#
824#   NB : The mailandpopup.sh shell script is now included in PyKota
825#
[1233]826#   NB : in ANY case, don't forget to redirect your command's standard output
827#        somewhere (e.g. >/dev/null) so that there's no perturbation to the
828#        underlying layer (filter or backend)
829#
[2837]830mailto : both
[852]831
[695]832
[1077]833
[2692]834# The value of the zero for account balance limitations.
[3148]835# If a user is limited by balance, he can print until
[2692]836# his balance reaches the value defined here. If unset,
837# the default value is 0. Any floating point value
838# is accepted.
[2837]839# You'll want to use this to give free credits to your users
840# at the start of the year for example.
[2692]841#
842# This option can only appear in the global section
[2837]843#
[2692]844# balancezero : -0.25
[2837]845#
[2692]846balancezero: 0.0
847
[2837]848
849
850# Grace delay in days
851# This value can be set either globally or per printer or both.
852# If both are defined, the printer option has priority.
853# If the value is not set then the default seven (7) days applies.
854#
855gracedelay : 7
856
857
858
859# Poor man's threshold
860# If account balance reaches below this amount, a warning message
861# is sent through the 'mailto' directive above.
862#
863# If unset, default poor man's threshold is 1.0.
864# This option can only appear in the global section
865#
866poorman : 1.0
867
868
869
[1077]870# Poor man's warning message
871# The warning message that is sent if the "poorman" value is reached
872# Again this must appear in the global section
[2837]873#
874poorwarn : Your Print Quota account balance is low.
[1077]875 Soon you'll not be allowed to print anymore.
876
[2837]877
878
[1077]879# Soft limit reached warning message
880# The warning message that is sent if the soft quota limit is reached
881# May appear either globally or on a per-printer basis
[2837]882#
[1077]883softwarn: Your Print Quota Soft Limit is reached.
884 This means that you may still be allowed to print for some
885 time, but you must contact your administrator to purchase
886 more print quota.
[2837]887
888
889
[1077]890# Hard limit reached error message
891# The error message that is sent if the hard quota limit is reached
892# May appear either globally or on a per-printer basis
[2837]893#
[1077]894hardwarn: Your Print Quota Hard Limit is reached.
895 This means that you are not allowed to print anymore.
896 Please contact your administrator at root@localhost
897 as soon as possible to solve the problem.
898
[806]899
900
[1594]901# Default policy to apply when either :
902#
903#       - Printer doesn't exist in PyKota's database
904#       - User doesn't exist in PyKota's database
905#       - User has no quota entry for this Printer in PyKota's database
906#
907# Value can be either allow or deny or external(some command here)
908#
[806]909# This value can be set either globally or per printer or both.
910# If both are defined, the printer option has priority.
[956]911# If the value is not set then the default policy DENY applies.
[1038]912# There's no policy wrt inexistant groups, they are ignored.
[1152]913#
914# external policy can be used to launch any external command of your choice,
[2837]915# for example to automatically add the user to the quota database, and set
916# page limits on the current printer if he is unknown :
[1152]917#
[2837]918#   policy: external(/usr/bin/pkusers --add --skipexisting %(username)s && /usr/bin/edpykota --add --skipexisting --printer %(printername)s --softlimit 50 --hardlimit 60 %(username)s)
[1152]919#
[1759]920# NB : If you want to limit users by their account balance value, it is preferable to
921# use the following policy to automate user account creation on first print :
922#
[2837]923#   policy: external(/usr/bin/autopykota --initbalance 25.0)
[1759]924#
925#   This will automatically add the user if he doesn't already exist, and
926#   set his initial balance value to 25.0 (for example). If the user already
927#   exists then his balance value will not be modified.
928#   Please don't use autopykota if you want to limit your users by page
929#   quota, and in any case, carefully read autopykota's help or manpage
930#   and understand its goal before using it in your own configuration.
931#
[1152]932# Of course you can launch any command of your choice with this, e.g. :
933#
[2837]934#   policy: external(/usr/local/bin/myadminscript.sh %(username)s)
[2838]935#
[1196]936# You can use :
[1152]937#
[1196]938#       '%(username)s'          will contain the user's name
939#       '%(printername)s'       will contain the printer's name
940#
[1781]941#   On your command line, to pass arguments to your command.
[1196]942#
[1594]943# If the printer, user, or user quota entry still doesn't exist after
944# external policy command was launched (the external command didn't add it),
945# or if an error occured during the execution of the external policy
946# command, then the job is rejected.
[1196]947#
[2837]948# By default, we reject all jobs from users not in the database :
949#
[956]950policy: deny
[695]951
[2837]952
953
[1372]954# Pre and Post Hooks
955# These directives allow the easy plug-in of any command of your choice
956# at different phases of PyKota's execution.
957# Pre and Post Hooks can access some of PyKota's internal information
958# by reading environment variables as described below.
959# The actual phase of PyKota's execution is available in the
960# PYKOTAPHASE environment variable.
961# Pre and Post Hooks can be defined either globally, per printer,
[1495]962# or both. If both are defined, the printer specific hook has
[1372]963# priority.
964#
965# List of available environment variables :
966# NB : Most of these variables are also available during the execution
[1483]967# of external commands defined in the accounter and mailto
[1372]968# directives.
969#
[2303]970# PYKOTADIRECTORY : The directory containing cupspykota's temporary files
971# PYKOTADATAFILE : The name of the temporary file which contains the
972#                  job's datas
[2445]973# PYKOTAFILENAME : The name of the file which contains the job's datas or
974#                  empty if datas come from stdin
[2303]975# PYKOTACONTROLFILE : The name of the IPP message file
[1767]976# PYKOTAMD5SUM : Contains an hexadecimal digest of the md5 sum of the job's datas
[1372]977# PYKOTAPHASE : BEFORE or AFTER the job is sent to the printer
[1422]978# PYKOTAACTION : ALLOW or DENY or WARN for current print job
[3012]979# PYKOTAUSERNAME : user's name, possibly modified through the overwrite_jobticket directive.
980# PYKOTAORIGINALUSERNAME : user's name, unmodified.
[1372]981# PYKOTAPRINTERNAME : printer's name
[1439]982# PYKOTAPGROUPS : list of printers groups the current printer is a member of
[1372]983# PYKOTAJOBID : job's id
984# PYKOTATITLE : job's title
985# PYKOTACOPIES : number of copies
986# PYKOTAOPTIONS : job's options
987# PYKOTABALANCE : user's account balance
988# PYKOTALIFETIMEPAID : user's grand total paid
[1421]989# PYKOTALIMITBY : user print limiting factor, for example 'quota' or 'balance'
[1372]990# PYKOTAPAGECOUNTER : user's page counter on this printer
991# PYKOTALIFEPAGECOUNTER : user's life time page counter on this printer
992# PYKOTASOFTLIMIT : user's soft page limit on this printer
993# PYKOTAHARDLIMIT : user's hard page limit on this printer
994# PYKOTADATELIMIT : user's soft to hard limit date limit on this printer
[1442]995# PYKOTASTATUS : contains "CANCELLED" when SIGTERM was received by PyKota
996#                else is not set.
[1517]997# PYKOTAJOBSIZEBYTES : contains the job's size in bytes. Always available.
[2062]998# PYKOTAPRECOMPUTEDJOBSIZE : contains the precomputed job's size
999# PYKOTAPRECOMPUTEDJOBPRICE : contains the precomputed job's price
[1502]1000# PYKOTAJOBORIGINATINGHOSTNAME : contains the client's hostname if
1001#                                it is possible to retrieve it.
[1694]1002# PYKOTAPRINTERHOSTNAME : the printer's hostname or IP address for network
1003#                         printers, or "localhost" if not defined or not
1004#                         meaningful.
[2054]1005# PYKOTAWARNCOUNT : the number of times the user was forbidden to print but a banner
1006#                   page was still printed on the current printer.                   
1007# PYKOTAOVERCHARGE : user's overcharging factor.
[3012]1008# PYKOTAJOBBILLING : Job's billing code if present, possibly modified through the overwrite_jobticket directive.
1009# PYKOTAORIGINALJOBBILLING : Job's billing code if present, unmodified.
[2474]1010# PYKOTAREASON : if the job was denied or a warning needs to be issued, contains
1011#                the message to send to the user.
[2882]1012# PYKOTAUSERDESCRIPTION : the user's textual description
1013# PYKOTAPRINTERDESCRIPTION : the printer's textual description
1014# PYKOTAPRINTERPASSTHROUGHMODE : the printer's passthrough mode
1015# PYKOTAPRINTERMAXJOBSIZE : the printer's maximal job size
[2884]1016# PYKOTAPRICEPERJOB : the printer's price per job
1017# PYKOTAPRICEPERPAGE : the printer's price per page
[2054]1018#
[1372]1019
[2838]1020
[1372]1021# PreHook : gets executed after being sure the user, printer and user quota
[1373]1022# entry on the printer both exist in the PyKota database, and after
1023# checking if the user is allowed to print or not, but just before
1024# the job is sent to the printer (if allowed)
[1372]1025# prehook has access to many environment variables :
1026#
1027# PYKOTAACTION contains either "ALLOW", "WARN" or "DENY" and
1028# represents the action which is to be done wrt the print job.
1029# PYKOTAPHASE contains 'BEFORE' during execution of prehook
1030#
1031# uncomment the line below to see what environment variables are available
1032# prehook: /usr/bin/printenv >/tmp/before
1033
[2837]1034
1035
[1372]1036# PostHook : gets executed after the job has been added to the history.
1037# posthook has access to all the environment variables defined above,
1038# as well as two additionnal environment variables : PYKOTAJOBPRICE
1039# and PYKOTAJOBSIZE.
1040# PYKOTAPHASE contains 'AFTER' during execution of posthook.
1041#
1042# uncomment the line below to see what environment variables are available
[1781]1043# posthook: /usr/bin/printenv >/tmp/after
[1372]1044
[2837]1045
1046
[1914]1047# AccountBanner : how should banner accounting be done ?
[1915]1048#
[1914]1049# If enabled, banner pages printed from StartingBanner and/or EndingBanner
1050# (depending on the value) will be included in the accounting for the
1051# print job
1052#
1053# If disabled, banner pages printed from StartingBanner and EndingBanner will
1054# *not* be included in the accounting for the print job
1055#
1056# IMPORTANT : CUPS generated banners are ALWAYS accounted for, although you
1057#             can refund them by using negative prices on printers.
1058#
1059# Allowed values : Starting | Ending | None | Both
1060#
1061#       - Starting : only the starting banner will be accounted for.
1062#       - Ending : only the ending banner will be accounted for.
1063#       - Both : both starting and ending banners will be accounted for.
1064#       - None : banners will not be accounted for.
1065#
1066# Default value :
1067# accountbanner: Both
1068
[2837]1069
1070
[2054]1071# Maximal number of times the banner will still be printed if
1072# the user is forbidden to print.
1073#
1074# This option can be set either globally or on a per printer basis.
1075# Allowed values are 0 or any positive integer.
1076# Default value is 0, which means that the banner won't be printed
1077# at all if the user is forbidden to print.
[2837]1078#
[2054]1079maxdenybanners: 0
1080
[2837]1081
1082
[3124]1083# If a job is cancelled, should any start or end banners still be printed
1084#
1085# This option can be set either globally or on a per printer basis.
1086# If set to yes, any defined banners will be printed
1087# If set to no, no banners will be printed
1088#
1089# This value defaults to yes
1090# printcancelledbanners: yes
1091
1092
[3158]1093# If a job is printed by the same person as the last job on the same printer,
1094# should banners be avoided to save some paper
1095#
1096# This option can be set either globally or on a per printer basis.
1097# If set to yes, any duplicate banners will be avoided forever
1098# If set to no or 0, no banners will be avoided (they will all be printed)
1099# If set to any positive integer, banners will be avoided if printed within
1100#     'integer' seconds of the last job
1101#
1102# This value defaults to no
1103# avoidduplicatebanners: yes
1104# avoidduplicatebanners: no
1105# avoidduplicatebanners: 600   
1106
1107
[1914]1108# StartingBanner : if defined will print a banner before the rest of the job
1109# is printed. The argument can be a printable file, or an executable file.
1110# If not executable, the file will be printed as is. If executable, the
[2837]1111# file will be executed and its standard output will be sent to the printer.
[1915]1112#
[1914]1113# In any case, the banner content which will be sent to the printer
[1931]1114# MUST be in a format your printer will accept !!!
[1914]1115#
1116# The pkbanner command included in PyKota can automatically generate
1117# starting and ending banners in the PostScript format. You can use
1118# this command in a pipe through GhostScript if your printer doesn't
1119# accept PostScript as an input format.
[1923]1120# NB : pkbanner's default page size is A4
[1914]1121#
[1930]1122# startingbanner: /home/joe/mystaticbanner.ps
[1923]1123# startingbanner: /usr/bin/pkbanner --pagesize=A4 --logo="/home/joe/mylogo.jpeg" --url="http://tech.example.com"
[1931]1124# startingbanner: /usr/bin/pkbanner | gs -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -sOutputFile=- -sDEVICE=lj5mono -
[1923]1125# startingbanner: /usr/bin/pkbanner
[1914]1126
[2837]1127
1128
[2326]1129# EndingBanner : if defined will print a banner after the job
1130# has been printed. The argument can be a printable file, or an executable file.
[1914]1131# If not executable, the file will be printed as is. If executable, the
[2837]1132# file will be executed and its standard output will be sent to the printer.
[1914]1133#
1134# In any case, the banner content which will be sent to the printer
1135# MUST be in a format your printer will accept !!!
1136#
1137# The pkbanner command included in PyKota can automatically generate
1138# starting and ending banners in the PostScript format. You can use
1139# this command in a pipe through GhostScript if your printer doesn't
1140# accept PostScript as an input format.
[1923]1141# NB : pkbanner's default page size is A4
[1914]1142#
[2193]1143# A static banner page
[1930]1144# endingbanner: /home/joe/mystaticbanner.ps
[2193]1145#
1146# A banner with personnalized logo and url
[1923]1147# endingbanner: /usr/bin/pkbanner --pagesize=A4 --logo="/home/joe/mylogo.jpeg" --url="http://tech.example.com"
[2193]1148#
1149# A banner in the format accepted by the printer
[1931]1150# endingbanner: /usr/bin/pkbanner | gs -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -sOutputFile=- -sDEVICE=lj5mono -
[2193]1151#
1152# A banner with more info on it, extracted from the yellow pages.
1153# the string "Phone 111222333444" will be added to the banner page
1154# if extractphone.sh returns 111222333444 for the current user.
1155# endingbanner: /usr/bin/pkbanner Phone `extractphone.sh $PYKOTAUSERNAME`
1156#
1157# Default PyKota banner
1158# endingbanner: /usr/bin/pkbanner
[1914]1159
[2837]1160
1161
[1495]1162# How should enforcement be done for this printer ?
1163#
1164# "laxist" is the default if value is not set, and allows users
1165# to be over quota on their last job.
1166#
1167# "strict" tries to prevent users from ever being over quota.
1168#
1169# Enforcement can be defined either globally, per printer,
1170# or both. If both are defined, the printer specific enforcement
1171# setting has priority.
1172#
1173# valid values : "strict" or "laxist"
1174#
[2837]1175# default value when not set is "laxist"
1176#
[1495]1177# enforcement : laxist
1178enforcement : strict
[2062]1179
[2837]1180
1181
[2062]1182# Should we trust the job size on this printer ?
1183#
[2111]1184# "trustjobsize : yes" is the default, the jobsize, either computed
[2062]1185# by the hardware or by software is trusted.
1186#
[2837]1187# "trustjobsize : >N:precomputed" : uses the precomputed value
1188#                                   if jobsize > N pages
[2111]1189# "trustjobsize : >N:25" : uses 25 if jobsize is >N pages
[2062]1190#
1191# General form : ">n:m" where n is a positive integer, and m is
1192# either the word 'precomputed' or a positive integer.
1193# The special form "yes" is also accepted and is the default.
1194#
1195# This directive can be set either globally or on a per printer
1196# basis. Use this directive when hardware accounting for a particular
1197# printer produces some glitches due to the printer returning
1198# incorrect answers.
1199#
1200# NB : DON'T MODIFY THIS IF YOU DON'T NEED TO. THIS IS ONLY TO BE USED
1201# AS A WORKAROUND FOR SOME PRINTERS. IT'S PROBABLY BETTER TO ALWAYS
1202# SET THIS DIRECTIVE TO 'yes'. THIS DIRECTIVE WILL ONLY BE HONORED
1203# IF PYKOTA DETECTS A DIFFERENCE BETWEEN THE PRECOMPUTED JOB SIZE
1204# AND THE JOB SIZE AS COMPUTED BY PYKOTA EITHER USING HARDWARE OR
1205# SOFTWARE.
[2837]1206#
[2062]1207trustjobsize : yes
[2066]1208
[2837]1209
1210
[2066]1211# Should we deny duplicate jobs ?
1212#
1213# A duplicate is a job sent twice (or more) in a row to the same printer
1214# by the same user.
1215#
1216# This can be defined either globally or on a per printer basis
1217# The default value is 'no', meaning that duplicate jobs are
1218# allowed.
1219#
1220# NB : if an user prints a job, a second user prints another
1221#      job, and the first user prints the first job again,
1222#      this is NOT considered as a duplicate since the two
1223#      identical jobs printed by the first user are not
1224#      one just after the other.
1225#
[2308]1226# Possible values are 'yes', 'no', or any other string.
1227# If the string is not recognized as a truth value,
1228# it is considered to be a command to launch.
1229# PyKota launches the command and parses its standard
1230# output. The special keywords 'ALLOW' and 'DENY' are
1231# recognized, allowing an external tool to decide if
1232# the job is to be allowed or denied.
[2066]1233#
[2308]1234# denyduplicates : /usr/bin/myowncommand with some arguments
1235# denyduplicates : yes
[2066]1236denyduplicates : no
1237
[2837]1238
1239
[2692]1240# Sets the delay in seconds after which two identical jobs are
1241# not considered as being a duplicate.
1242#
1243# This can be defined either globally or on a per printer basis
1244# The default value if not set is 0, for 0 seconds.
1245# duplicatesdelay : 300
1246duplicatesdelay : 0
1247
[2837]1248
1249
[3025]1250# Sets the maximum number of seconds to wait for the printer
1251# being in 'printing' mode once the job has been sent to it.
1252# Once this delay is expired, PyKota will consider this job
1253# will never be printed, aborts the hardware accounting
1254# process, and uses the latest internal page counter value seen.
1255#
1256# Increasing this value, or setting it to 0, may help with some
1257# printers which don't conform to RFC3805. Problem reported on a
1258# Samsung ML2551n gave a way for clever students to bypass
1259# hardware accounting entirely by removing the paper from
1260# the paper tray before the job had begun to print, then
1261# waiting 60 seconds, and putting the paper back in the tray...
1262#
1263# IMPORTANT : always ensure that your printers' firmware is up
1264# to date.
1265#
1266# This directive can be set either globally or on a per printer
1267# basis.
1268#
1269# When not set, an hardcoded value of 60 seconds is used.
1270# When set to 0, PyKota will wait indefinitely until the
1271# printer switches to the 'printing' status.
1272noprintingmaxdelay : 60
[3037]1273
1274
1275
[3180]1276# Defines the number of times the 'idle' printer status
1277# has to be reported before it being considered stable.
1278# Each check is done every 'statusstabilizationdelay' seconds
1279# as defined below.
1280#
1281# This directive can be set either globally or on a per printer
1282# basis.
1283#
1284# When not set, an hardcoded value of 5 times is used.
1285# The value must be a strictly positive integer.
1286statusstabilizationloops = 5
1287
1288
1289
1290# Defines the number of seconds to wait between two consecutive
1291# checks of the printer's status when using hardware accounting.
1292#
1293# Each check is done up to 'statusstabilizationloops' times.
1294#
1295# This directive can be set either globally or on a per printer
1296# basis.
1297#
1298# When not set, an hardcoded value of 4.0 seconds is used.
1299# The value must be a positive floating point value greater
1300# than or equal to 0.25 seconds.
1301statusstabilizationdelay = 4.0
1302
1303
1304
[3037]1305# Defines a set of coefficients for ink accounting.
[3044]1306#
1307# Each ink coefficient is the factor of the price per page
1308# you set with pkprinters which would represent the cost
1309# of a page covered at 100% with ink in this particular color.
1310#
[3037]1311# With these coefficients, the exact cost of each page
1312# can be computed : for each ink color in the colorspace specified
1313# in the preaccounter and/or accounter directives, we multiply the
1314# base cost per page set with pkprinters by this ink color's coefficient
1315# and by the percent of that page covered with such ink. Then we
1316# sum the values, and repeat the operation for each page. We then
1317# add the base cost per job set with pkprinters, and repeat
1318# the operation recursively in case of nested printers groups.
1319#
[3044]1320# The names of the coefficients you should set depend on the colorspace
1321# you want to use for ink accounting :
1322#
1323#       cmyk :
1324#               coefficient_cyan
1325#               coefficient_magenta
1326#               coefficient_yellow
1327#               coefficient_black
1328#
1329#       cmy :
1330#               coefficient_cyan
1331#               coefficient_magenta
1332#               coefficient_yellow
1333#
1334#       rgb :
1335#               coefficient_red
1336#               coefficient_green
1337#               coefficient_blue
1338#
1339#       bw :
1340#               coefficient_black
1341#
[3122]1342#       gc :
1343#               coefficient_grayscale
1344#               coefficient_colored
1345#
[3037]1346# Any coefficient which is not set is considered to be equal to 1.0
1347#
1348# Coefficients can be set either in the [global] section or in any
1349# [printqueuename] section. The latter taking precedence, as always.
1350#
1351#coefficient_cyan : 1.2
1352#coefficient_magenta : 3
1353#coefficient_yellow : 1.1
1354#coefficient_black : 1.0
Note: See TracBrowser for help on using the browser.