Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
deleting cups jobs on user logoff
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
prometheus0815
n00b
n00b


Joined: 01 Nov 2003
Posts: 29
Location: Freiburg, Germany

PostPosted: Wed Jan 14, 2004 12:48 pm    Post subject: deleting cups jobs on user logoff Reply with quote

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
View user's profile Send private message
Spooky Ghost
Apprentice
Apprentice


Joined: 19 Apr 2002
Posts: 210
Location: Bristol, United Kingdom

PostPosted: Wed Jan 14, 2004 2:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
fleed
l33t
l33t


Joined: 28 Aug 2002
Posts: 756
Location: London

PostPosted: Wed Jan 14, 2004 3:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum