cups.cs
cups.cs
is a CNAME.
You can login to the host using your core.cs regional UNIX password.
You must login from cscfnet, otherwise, you will be denied access. Check
the file /etc/hosts.allow
for the current access configuration.
cups.cs
has CUPS (Common Unix Printing System) and Pykota
installed on it. The Pykota system is a print accounting system with
many features.
Anyone in the Unix pykota
group can run Pykota commands. To check
whether you are in the groups type groups useruserid
. You should see
pykota
listed. If this is not the case. Please have a system administrator
add you to the group (not currently managed by our accounting system).
If the user xyz
does not exist in the database, then
pkusers --list xyzyields
pkusers --list xyz /usr/bin/pkusers : There's no user matching xyzwhereas if the user exists in the database one gets something like
xyz - <xyz@uwaterloo.ca> Limited by : quota Account balance : 0.00 Total paid so far : 0.00 Overcharging factor : 1.00
To add the user xyz
to the users database run
pkusers --add xyz
To see whether a user xyz
(remember just because a user is in the database does not mean
they have been added to any print queues!) belongs to a print queue ABC
run
edpykota --list --printer ABC xyzIt is required that the user has been added to the Pykota database as described above. Remember this does NOT mean they can print!
xyz
that exists in the users database and a print queue ABC
that exists in the print queue database we want to add the user xyz
to ABC
. We
accomplish this by running
edpykota --add --printer ABC xyz
The default behaviour of this command is to allow the user to print as many pages as they want as often as they want. Accounting on how much they print will be done. It is possible to change this behaviour in subtle ways that will describe as the need arises later in this document.
xyz
from print queue ABC
run
edpykota --delete --printer ABC xyz
CUPS has a native (not part of pykota) facility to allow or deny a list of users.
For each printer listed by http://cups.cs:631/printers/ , there is a button labelled "Set Allowed Users".
If there are any users in the allow or deny lists, anyone attempting to use the printer must first pass this hurdle before pykota is asked whether they can print.
This is easy to miss and sure to cause confusion.
So, make sure the "Set Allowed Users" list is empty when using a printer with pykota.
repykota
is quite useful for this purpose.
Typing it without any options and piping it through less
is instructive,
that is, type repykota|less
. Some examples usages are given by:
repykota --printer lp
will print the quota status for all users who use the lp printer
and repykota --printer "laser*,*pson" jerome "jo*"
will print the quota status for user jerome and all users whose name begins
with "jo" on all printers which name begins with "laser" or ends with
"pson".
xyz
is in the user database (see above for definition) and assume we have
added them to a print queue ABC
(see above for how to do this). Suppose instead of allowing
unlimited printing we want to limit them to a fixed number of pages, say an upper bound of 550 pages
(not to be exceeded, also known as a hard limit) and and a lower limit of 500 (can be exceeded a bit, known
as a soft limit) pages. Then we do
edpykota --printer ABC -S 500 -H 550 xyzIf we run
repykota --printer ABC xyz
we should see
repykota --printer ABC xyz Report for user quota on printer ABC () Pages grace time: 7 days Price per job: 0.000 Price per page: 0.000 User overcharge used soft hard balance grace total paid warn ----------------------------------------------------------------------------------------------- xyz -Q 1.0 7 500 550 0.00 7 0.00 0 Total : 7 0.00 Real : 753Notice that we could charge a price if we wanted to. Ultimately the man page of the command
edpykota
is authoritative. Having said
that, we hope to provide instructive examples in this wiki that will cover all cases as they come up.
edpykota --printer ABC -S 500 -H 550This will not zero everyone's current print count, just set their limits.
The command pkprinters
is used to add and delete pre-existing CUPS print queues
to Pykota's database. It has a command line syntax that is very similar to that of
pkusers
, in particular we can find out whether ABC
exists by running
pkprinters --list ABCIf Pykota claims to be not aware of the print queue, you can add to Pykota by by running
pkprinters --add ABC
It is highly likely that a UNIX system administrator will have already done this step but for reference sake we include a note here, see CupsCsServer#A_necessary_pre_condition_for_PY for an important caveat if you encounter difficulties with the command below.