View previous topic :: View next topic |
Author |
Message |
prometheus0815 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/18264299533fa318622f09d.gif)
Joined: 01 Nov 2003 Posts: 29 Location: Freiburg, Germany
|
Posted: Wed Jan 14, 2004 12:48 pm Post subject: deleting cups jobs on user logoff |
|
|
hi all!
i'm running a gentoo-based ltsp server with about 20 clients. my problem is that the the laserjet (driven via standalone printserver) is usually out of paper (users are supposed to bring their own) and then the cups queue quickly fills up with the jobs of users who gave up and left.
my idea is to delete each user's print jobs once he or she logs off. this way, the users would have to remain logged on as long as their documents are being printet, but the queue would never again be blocked by someone's old jobs.
the point is: how can i implement that? i don't have a damn clue about cups (it was simply working so far), and i really hope someone out there has an idea. this problem is driving me (and the users) mad over time...
any kind of help will be appreciated, even if it's just the tiniest hint on how to handle that. thanks in advance! _________________ Man must shape his tools, lest they shape him. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Spooky Ghost Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/27597644140b20c4e65b4f.gif)
Joined: 19 Apr 2002 Posts: 210 Location: Bristol, United Kingdom
|
Posted: Wed Jan 14, 2004 2:45 pm Post subject: |
|
|
If the shell is bash you could create a ~/.bash_logout with a cancel -u `whoami` in it. However this probably wouldn't work so well if your users can have simulataneous logons.
How about a cron script that parses the output from lpstat and checks that the owner of a job is currently logged on to the system? If they aren't connected then again do a cancel -u. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
fleed l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/1800640613415a758ba4ac3.png)
Joined: 28 Aug 2002 Posts: 756 Location: London
|
Posted: Wed Jan 14, 2004 3:11 pm Post subject: |
|
|
Adding to Spooky Ghost's idea (or rather, combining the two ideas), add a script to bash_logout that checks if this is the last shell and cancels all the jobs. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|