[cups.general] Global print quota for guest/nobody?
Jerome Alet
alet at librelogiciel.com
Tue Jan 29 12:25:12 PST 2008
On Tue, Jan 29, 2008 at 10:58:51AM -0800, John wrote:
> I have made a print server using Ubuntu 7.10 server, its also a simple file server. I did not make a domain controller, my main objective is to create a print server that restricts people from printing massive amounts of pages. My original post can be found here:
>
> http://www.cups.org/newsgroups.php?s15183+gcups.general+v15183+T0
>
> My question/problem boils down to;
> -Can a guest/nobody account (no authentication used) have a print
> restriction placed on them? I was trying to impose 10 pages per
> minute.
> -If so, will individual computers be considered unique? For
> example if my neighbor and I are behind the same print server
> printing to the same printer, and my neighbor prints 10 pages, will
> I have to wait 1 minute to print?
To the best of my knowledge, the only print quota software which
allows you to do this (differentiate identical usernames based on
hostname) easily is PyKota (http://www.pykota.com).
With it you'll be able (with a 3 lines shell script, including the
shebang line) to replace the username at print time, automatically.
For example if you want to differentiate between client hosts,
you'll replace the user's name (e.g. guest) with the concatenation
of user's name and client hostname (e.g. host1.example.com), at printing time,
to record all accounting as, for example : 'guest.host1.example.com'
With exactly the same method, you could do limit printing based on
client's hostname only, or whatever information you want, the only
limit is your imagination and you ability to use the 'echo' shell
command...
Of course this can be done for some printers / some usernames / some
hostnames only.
To reset the page counts every minute, you've got several solutions
as well, depending on if you want to do this at the very same time
for all users (in this case setup a crontab), or really 1 minute after
the last printed job, for each user (which is very different). In the
latter case, you'll have to change a directive in PyKota's configuration
file to automate the reset of the page counter one minute after the
job has been printed.
Beware with these resets : you may put some heavy load on
your database backend if you've got lots of users and the time
between two resets is short.
hth
Jerome Alet
More information about the cups
mailing list