Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

print queue filters

Status
Not open for further replies.

drotz

MIS
Apr 17, 2001
9
CA
we have a situation where an application creates data that is processed to produce new output, i.e. formatting, calling a stored form from the printer, etc.

this script is called by the application as a print "queue". in solaris it worked as a virutal printer with a filter pointing to an actual queue.

the script to process the data is written in perl. this script also sends the processed results to a queue (lp -dxxxx).

we do not know how to define this? as a backend program or a queue filter?

any comments?

the redbook talks of defining new filters ...... no idea how to do this? it says the "set f1= ....." command. ???


 
This sounds like you need a user-defined backend program - this is where the qdaemon executes this by redirecting the print stream as standard input to the shell script.

You can then add your formatting and echo out to standard output.

Add your print queue through smit:

smitty spooler
select 'Add a Print Queue'
select 'Other User Defined Backend'

Then add your queue name, device, and backend program pathname.


 
yes, i've tried that as well as filters.

we have a perl script that i would like to be the backend program. it does not seem to execute, although i place a dummy ksh script i tries (and fails) to run.

is perl supported for backend?

the other issue is the perl script has an lp command fo ra specific printer in it as well.
 
I'm afraid I don't know the answer to whether perl is supported for backend - perhaps someone else can help there?

As far as the dummy ksh backend is concerned, I could only comment if I could see the error message. Although I've never written one myself, I saw one recently that split one request to 2 queues, and the script consisted of the following 2 lines:

eval "cat $*"|lp -c dqueue_a
eval "cat $*"|lp -c dqueue_b
 
recap .... the app cannot be modified and send output as lpr -dxxxxx ..... i need to "interact" with the queue on that lpr line to further process the data stream, then send it off to another queue.

below (error message)is the message when i tried to run test2.sh from backend.

contents of test2.sh:
eval "cat $*" | lp -c virprt1

qconfig for virprt1:
virprt1:
device = @ritorxx
up = TRUE
host = ritorxx
s_statfilter = /usr/lib/lpd/aixshort
l_statfilter = /usr/lib/lpd/aixlong
rq = pr1
@ritorxx:
backend = /usr/local/bin/test2.sh

error message:

"Message from root on rc_ho_rs1 (UNKNOWN) [Wed Jul 17 09:40:02 EDT 2002] ...
Message from queueing system:
0781-075 Qdaemon couldn't exec /usr/local/bin/test2.sh.
Errno = 8: Cannot run a file that does not have a valid format.<EOT>

Message from root on rc_ho_rs1 (UNKNOWN) [Wed Jul 17 09:40:02 EDT 2002] ...
Message from queueing system:
0781-087 Could not run your request in.txt for device virprt1:mad:ritorxx.<EOT>&quot;
 
might just be that you need test2.sh to be thus:

eval &quot;cat $*&quot; | lp -c dvirprt1




 
Just a suggestion: have a look at the &quot;bsh&quot; queue that comes in AIX by default (or maybe at least commented out of /etc/qconfig).
 
thanks .... tried it. it work sfine for ksh scripts. i changed the backend to /usr/bin/perl and then tried queuing a perl script .... nothing.

maybe the qdeamon does not know how to run a perl script?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top