APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed
From: "Steve M. Fabac, Jr." <smfa...@att.net>
Subject: Re: Unable to get jobs out of print queue
Date: Thu, 25 Sep 2008 13:16:55 -0500
Message-ID: <48DBD597.4020403@att.net> 
References: <9bdf07d4-8161-4c61-bc18-fd5dbdd22658@t54g2000hsg.googlegroups.com> 

dthacker wrote:
> Hi,
> I'm having problems getting a remote printer and print queue set up.
> The queue is supposed to send jobs to a jet direct device running
> lpd.   We have this set up running successfully at several locations
> in the company, but this printer seems to have configuration issues.
> The scheduler is running:
> # ps -ef | grep lpsched
>     root   287     1  0 06:01:55       ?    00:00:00 /usr/lib/lpsched
>     root  1107  1100  0 10:18:16   ttyp1    00:00:00 grep lpsched
> The printer seems to be accepting requests, but it looks like there
> may be an irregularity in the queue config files:
> # lpstat -a
> s130ptr001:
> atebivr not accepting requests since Sun Oct 09 06:01:55 2005 -
>         new destination
> s130ptr002 accepting requests since Thu Aug 21 13:58:59 2008
> s130ptr001 accepting requests since Mon Sep 22 16:49:27 2008
> If you send a job to it, the job thinks the queue is not enabled:
> # lpstat
> unable to get network name for local machine scosysv.mycomp.com
> no entries
> unable to get network name for local machine scosysv.mycomp.com
> waiting for queue to be enabled on s130ptr001
> Req-Id                  Owner           Size     Date
> s130ptr001-0            root            256      Sep 23 09:42
> s130ptr001-1            root            1909     Sep 23 16:33
> s130ptr001-2            root            1909     Sep 24 10:23
> The printcap file looks ok:
> # more /etc/printcap
> # Remote Line Printer (BSD format)
> atebivr:\
>         :lp=:rm=netterm1:rp=atebivr:sd=/usr/spool/lpd/atebivr:mx#0:
> s130ptr002:\
>         :lp=/dev/lp0:ex:sd=/usr/spool/lpd/s130ptr002:mx#0:
> s130ptr001:\
>         :lp=:rm=s130ptr001:ex:rp=s130ptr001:sd=/usr/spool/lpd/
> s130ptr001:mx#0:
> It looks to me like I've got a dup entry somewhere in the print
> subsystem, but I don't see it.  What else could I check?
> TIA Dave

I can't help you with your rlp problems. I can only suggest that you abandon
rlp and install netcat since you are printing to a HPJetDirect print server.

If you HAVE to use rlp (print device only accepts rlp jobs), then I second
Brian White's post:
> Personally I only ever use this:
> https://www.aljex.com/bkw/sco/#rlpnc
> and this with it.
> https://www.aljex.com/bkw/sco/#rlpr
> The first provides a convenient way to use netcat and rlpr, and includes 
> netcat already, in an out of the way place thet the included printer model 
> script expects, but which won't clobber or interfer with any other netcat 
> binary you may already have.
> The second adds rlpr as a seperate package that the first is already 
> prepared to use.
> Basically just unpack the two tars, create printer(s) in scoadmin using 
> device /dev/null and model Net, and edit a line in /etc/printers where the 
> first field is the same as the name of the Net printer.

I have a client that had 10 rlp based printers and it was an administration
nightmare. I finally took the time to move them all to netcat.

But the client had one printer named ReformPRN that is a fancy invoice
printer running under Windows that accepts print jobs and merges the job
with a form image. The Reform print Queue only accepts jobs via rlp.

So I had to install rlpr as recommended by Brian. Problem solved.

An additional benefit of rlpr is the ability to support home based
teleworkers printing to their local Windows printer from the UNIX server.

A simple modification to the users .profile logs the VPN endpoint associated
with the home worker to .rip_printer file in their home directory. The
/etc/printers support file and the rlpnc based modifications to my standard
HPLaserJet.net script happily sends the print job to the users home computer
where Windows print services for UNIX is installed (lpd) with the designated
share name rp_remote.

> My /etc/printers file:
# /etc/printers
# "/usr/bin/printeradmin add | sh" will add all printers below
# "/usr/bin/printeradmin add printer_name | sh" will add the named printer
# "/usr/bin/printeradmin"  will print help message
# NOTE: the record format below has semicolon in place of colon
#       replace the ";" with ":" in active records below
# printer_name;host_name;port_number;comment;model
# printer_name: UNIX printer name
#    host_name: Host name in /etc/hosts for IP address
#         port: Printserver dependent 9100 for HPJet direct
#      comment: Comment that appears in mkdev lp screen
#        model: /usr/spool/lp/model/model_name
#  Stock netcat models: HPLaserJet.net Netcat.dotmatrix
# Example of Entry for ActiveFax HP laserJet emulation
# Must embed ActiveFax fields in print stream prior to sending to lp.
#fax;faxserver;9150;Active Fax server on Windows host;HPLaserJet.net
fax:faxhost:9150:ActivFax server on Win98
homeptr:localhost:SSH_PRINTER:remote printer for ssh USER:homeptr
report:report:report:Print to /tmp/report.out:Netcat.dotmatrix
cpxerox:cpxerox:9100:Xerox Copier-printer corporate:HPLaserJet.net
azxerox:azxerox:9100:Xerox Copier-printer AZ plant:HPLaserJet.net
txxerox:txxerox:9100:Xerox Copier-printer TX plant:HPLaserJet.net
ilxerox:ilxerox:9100:Xerox Copier-printer IL plant:HPLaserJet.net
p7:RLP_PRINTER:rp_remote:Remote Home users printer:RLPR.net
ReformPRN:office1:ReformPRN:NEW Invoice printer (Copy machine):RLPR.net
pr5:pr5:9100:OLD Invoice Printer:Netcat.dotmatrix
barpkg:zebrahp:9100:Package Labels:zebra.net

# printeradmin

  Usage: printeradmin add    <- create all printers in /etc/printers
         printeradmin delete <- delete all printers in /etc/printers

  Usage: printeradmin add    name <- create named printer in /etc/printers
         printeradmin delete name <- delete named printer in /etc/printers

# printeradmin add

/usr/lib/lpadmin -p pr5 -v /dev/null -m Netcat.dotmatrix -D "OLD Invoice Printer"
/usr/lib/accept  pr5
enable  pr5
/usr/lib/lpadmin -p barpkg -v /dev/null -m zebra.net -D "Package Labels"
/usr/lib/accept  barpkg
enable  barpkg
/usr/lib/lpadmin -p barbin -v /dev/null -m zebra.net -D "Bin Labels"
/usr/lib/accept  barbin
enable  barbin
/usr/lib/lpadmin -p lexped -v /dev/null -m HPLaserJet.net -D "Tammi's (Lexmark Opra S 1855)"
/usr/lib/accept  lexped
enable  lexped
/usr/lib/lpadmin -p lexrec -v /dev/null -m HPLaserJet.net -D "Receiving (Lexmark Opra S 1855)"
/usr/lib/accept  lexrec
enable  lexrec
/usr/lib/lpadmin -p lex -v /dev/null -m HPLaserJet.net -D "Warehouse (Lexmark Opra S 1855)"
/usr/lib/accept  lex
enable  lex

> Excerpt from remote users .profile:
[ -n "$SSH_CLIENT" ] && {
echo "2022" > .ssh_printer
chmod 644 .ssh_printer
export TZ
} || {
         TTY=`tty`;export TTY
         nTTY=`basename ${TTY}`;export nTTY
         rIP=`who -x | grep "${nTTY} " | awk ' { print $6 } '` ;export rIP
         [ "$rIP" = "" ] || echo $rIP > .rip_printer
# NOTE: .233 is the Windows Terminal services host IP. Users running TS need to
# login via telnet from home pc over the vpn first to record their VPN IP to
# .rip_printer and then may close telnet and run telnet client from Terminal Services
# session to cut down VPN traffic. Print jobs to p7 will be directed to host IP
# taken from .rip_printer in the users home directory.

> Excerpt from interface script RLPR.net:
# Look for HOST and Port address
PRTSETUP=`grep "^$printer:" /etc/printers`
if [ $? = 0 ]
PRTHOST=`echo $PRTSETUP|awk -F: '{ print $2 }'`
PRTPORT=`echo $PRTSETUP|awk -F: '{ print $3 }'`
  exit 1

         # user home directory  = sixth field of /etc/passwd
         uhome=`sed -n "s/^$name:.*:.*:.*:.*:\(.*\):.*$/\1/p" /etc/passwd`
         PRTHOST=`cat $uhome/.rip_printer`
# send the file(s) to the standard out $copies times
while   [ "$copies" -gt 0 ]

         for file
                 0<${file} eval ${FILTER}
         copies=`expr $copies - 1`
done ) | /usr/local/bin/rlpr -H $PRTHOST -P $PRTPORT
sleep 1
exit 0

> Excerpt from HPLaserJet.net:

# Look for HOST and Port address
PRTSETUP=`grep "^$printer:" /etc/printers`
if [ $? = 0 ]
PRTHOST=`echo $PRTSETUP|awk -F: '{ print $2 }'`
PRTPORT=`echo $PRTSETUP|awk -F: '{ print $3 }'`
  exit 1

# send the file(s) to the standard out $copies times
while   [ "$copies" -gt 0 ]

         for file
                 0<${file} eval ${FILTER}
         copies=`expr $copies - 1`
done ) | /usr/bin/netcat -h $PRTHOST -p $PRTPORT
sleep 1
exit 0

                                      Steve Fabac
                                       S.M. Fabac & Associates

Zebra note: Redhat Linux Print Queue Explained for ZebraNet Print Server II

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> Unable to get jobs out of print queue

Inexpensive and informative Apple related e-books:

Take Control of Pages

Take Control of the Mac Command Line with Terminal, Second Edition

Are Your Bits Flipped?

Digital Sharing Crash Course

Take Control of iCloud, Fifth Edition

Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

If it looks like a duck, and quacks like a duck, we have at least to consider the possibility that we have a small aquatic bird of the family Anatidae on our hands. (Douglas Adams)

Linux posts

Troubleshooting posts

This post tagged:



Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode

SCO Unix Sales, Support, & Service

Phone:  707-SCO-UNIX (707-726-8649Toll Free: 833-SCO-UNIX (833-726-8649)