LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-26-2013, 12:23 PM   #1
defide
LQ Newbie
 
Registered: Nov 2013
Posts: 2

Rep: Reputation: Disabled
CUPS Interface Script By-Passed


I am trying to set up a CUPS printer that will print a single print
job on two separate printers. I saw a technique online using a CUPS
interface script, but when I set it up it seems the interface script
is being by-passed when I send a job to the printer.

The method I found and am trying to use is to create a printer with
the URI set to /dev/null and define an interface on that same printer
that spawns two new print jobs, one to each of the two printers I want
it to print on. Here is what I have done:

Created interface_script:

#!/bin/bash
echo "Interface script is running." >>/home/me/debug
/usr/bin/lp -d printer1 $6
/usr/bin/lp -d printer2 $6
_________________________________

Created Printer:

lpadmin -p twoprint -i interface_script -v /dev/null -E

The lpadmin copies the interface_script into /etc/cups/interfaces/twoprint
as expected and the permissions on the twoprint script are 755. The CUPS
LogLevel is set to debug2 and I don't see anything that looks to me to be
an obvious problem in /var/log/cups/error_log after I send a print job to
twoprint.

Does anyone have an idea why the twoprint interface script is not getting run?
 
Old 11-26-2013, 09:58 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,511

Rep: Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131
Have you verified the new printer does not show any errors and is enabled? Have you checked the jobs to see if anything is stuck in the queue?

With a similar set up that I had already had but using a real printer i.e. instead of /dev/null I used ipp://localhost/printers/myprinter and a interface script it worked for me.

The next step is to create a null printer to duplicate your exact configuration.
 
Old 11-26-2013, 10:12 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,511

Rep: Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131
Ok I duplicated your setup and it worked for me.

What distribution/version are you running?
 
Old 11-28-2013, 10:45 PM   #4
defide
LQ Newbie
 
Registered: Nov 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
michaelk,

Thank you for working on my problem and for your reply. The fact that you were able to get it to work pushed me to keep trying. I eventually figured out what I was doing wrong and it was not in the set up - it was in the lp command I was using to send the original job to the printer. Being fairly new to linux, I used lp command options I had seen used other places without really looking into what they do. I was using the -o raw option which, as I now understand, tells cups to not execute any interfaces/filters. I sure feel stupid right now. When I enter the lp command like this the job prints on both printer1 and printer2:

lp -s -d twoprint filename

Thanks again for setting it up yourself and getting it to work.
 
Old 11-29-2013, 11:50 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,511

Rep: Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131Reputation: 3131
Your welcome.

You can mark this thread as solved via the thread tools menu at the top of the page.
 
  


Reply


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
How are arguments passed to a bash script? jiml8 Programming 1 04-09-2009 06:28 PM
Variable passed from one script to the next manwithaplan Linux - Newbie 2 03-11-2009 07:28 PM
Using C API; first query passed passed by program to MySQL is successful, second quer weibullguy Programming 2 06-12-2007 11:45 PM
client authentication passed onto perl script paul_mat Programming 1 02-12-2006 11:47 PM
bash script ? -- spaces in passed parameters azwr Linux - Newbie 3 06-18-2004 07:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:21 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration