Custom printer scripts

From: Rahveen Ramnath <Rahveen.Ramnath_at_unilever.com>
Date: Fri, 15 Jun 2001 10:41:40 +0200

Hello Tru64-Unix-Managers.

I am new to Tru64 Unix. I am trying to configure a printer to execute a Unix
script when it receives a request to print a report. At this stage, I would
simply like the script to copy the contents of the report to a file in the /tmp
directory. I have searched this list and was able to find some information on
how to achieve this and have managed to do this with some degree of success.
Here are the details of what I have done:

The printer definition in /etc/printcap
------------------------------------------------

loc2|lp4|loc2:\
        :of=/home/root/rrprn.sh:\
        :lp=/dev/null:\
        :sd=/usr/spool/lpd4:


My script /home/root/rrprn.sh
--------------------------------------
#! /bin/csh -f
/bin/cat > /tmp/test$$

The problem is that when I send a report to this printer (lp -d loc2
/etc/hosts), the report just sits in the queue. If I shut down and restart
lpd, it would then print process only the FIRST report in the queue and not the
subsequent ones. I cannot find out what is wrong. Please help.


Output from lpstat
-----------------------
loc2:
Fri Jun 15 10:14:51 2001:
Rank Pri Owner Job Files Total Size
1st 0 root 11 /etc/hosts 2090 bytes

Output from lpc
--------------------
lpc> status loc2
loc2:
        printer is on device '/dev/null' speed -1
        queuing is enabled
        printing is enabled
        1 entry in spool area
        Fri Jun 15 10:14:51 2001:
lpc>

Logs
------
Nothing appears in the logs below
/usr/adm/lp*
/var/adm/syslog.dated/current/lpr.log



Thanks

Rahveen Ramnath
Unilever South Africa, Durban
email: rahveen.ramnath_at_unilever.com
Received on Fri Jun 15 2001 - 08:38:36 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:42 NZDT