LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices



Reply
 
Search this Thread
Old 06-28-2010, 03:59 PM   #1
Elcrapocrew
LQ Newbie
 
Registered: Jan 2008
Posts: 6

Rep: Reputation: 0
run script when a users prints


How do I write a script (or more correctly, a daemon) that will listen for print jobs and run a script when the user prints?

Basically when the user prints I want to open a browser window that takes them to a portal we have setup to allow them to release the print job, the job will go to the print server immediately, so I don't have to worry about standing in the way of the print job. I just wan to open firefox after the job is submitted to the server.

Any Ideas?
 
Old 06-28-2010, 04:24 PM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 15,102

Rep: Reputation: 2719Reputation: 2719Reputation: 2719Reputation: 2719Reputation: 2719Reputation: 2719Reputation: 2719Reputation: 2719Reputation: 2719Reputation: 2719Reputation: 2719
Quote:
Originally Posted by Elcrapocrew View Post
How do I write a script (or more correctly, a daemon) that will listen for print jobs and run a script when the user prints?

Basically when the user prints I want to open a browser window that takes them to a portal we have setup to allow them to release the print job, the job will go to the print server immediately, so I don't have to worry about standing in the way of the print job. I just wan to open firefox after the job is submitted to the server.

Any Ideas?
Nope, not with details. What are the clients running? How are the printers attached now? How do the users print now??

Best idea I'd have, would be to do away with the portal, web page, clicking, etc., and just go straight through a CUPS server. You'd have a log of who printed what, when, etc., and users wouldn't have to click anything, run any scripts, etc.
 
Old 06-28-2010, 05:45 PM   #3
Elcrapocrew
LQ Newbie
 
Registered: Jan 2008
Posts: 6

Original Poster
Rep: Reputation: 0
hahaha, TB0ne you have no idea how badly I would like to do away with that portal page!

Let me give you a bit more info:

I work for a small private college that is thinking about using linux thin clients for our dorm lab computers. We have an existing printing solution that allows our students to print and charges them a set amount depending on the printing in question (color, location, etc.) The print server is Windows Server 2003 and the clients will probably be either Linux Mint or BrowserLinux.

Once the client prints, the printing software on the server catches the job and holds it in a queue, then the student needs to go to a webpage and login with their AD credentials to see the print jobs sent from that computer.

From there the student selects the job they want to print, if the student has enough credit the job prints and the student goes along their merry way.

All of this is set in stone and is non-negotiable.

If the client is windows based, the user will get a popup message after the job is submitted to the print server. This popup is nothing more than an IE window with all the tool bars stripped off. The problem is that the printing solution provider does not have a linux client that does the same thing. The functionality seems pretty basic, when the user prints a job I want to kick off a script that opens firefox and sends them to the portal page that they can release their job from.

I figure I will need to either listen for print events (run a daemon) or hook into cups and have a post print event (kick off a script), either one works for me.

A nasty hackish way could be to watch the syslogs, grepping for print events and firing off the script if it sees one ... but something about that just doesn't sit right with me ... it seems to cobbled together. I am looking for a more elegant solution, elegance = reliability in my experience ... but I guess that largely depends on your idea of elegance ... but I digress : )

Last edited by Elcrapocrew; 06-28-2010 at 05:45 PM. Reason: misspelling
 
  


Reply

Tags
printing, script


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
halevt run as init script doesn't mount for users nemesis9 Linux - Desktop 1 11-05-2009 08:38 AM
how to run a script in startup linux or logs on users kavehiks Linux - General 1 10-22-2009 06:22 PM
Looking for a shell script that prints a file only if it has more than 10 lines djfog Linux - Newbie 8 07-01-2008 01:23 PM
prevent users to run the same script at the same time, on the same machine pvpnguyen Programming 2 09-05-2007 09:52 PM
cups prints poorly, while lpr from command line prints well spindles Linux - Software 2 04-01-2006 05:02 AM


All times are GMT -5. The time now is 06:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration