Solved lp setup

I am transferring a virtual printer setup from my development machine, where it works, to a custom jail running on a different host. The printcap file has been set identically to that of the first system. When I test the virtual printer then spool files are created in the appropriate /var/spool/lpd/X directory. But they are not sent to the actual printer. I am trying to find out why.

Both systems have cups installed. I am aware of the difference between /usr/bin/lp* and /usr/local/bin/lp*. That said, the lp command used on the first host is the same as that used on the second:
Code:
root@vhost01:~ # which lp
/usr/bin/lp

root@sshpipe-2:~ # which lp
/usr/bin/lp

The lpq utility shows the jobs but claims that no lpd daemon is running.
Code:
lpq -a
np4172:
Warning: no daemon present
Rank   Owner      Job  Files                                 Total Size
1st    hp3000     0    (standard input)                      242979 bytes
2nd    root       1    ...00sshpipe-2.hamilton.harte-lyne.ca 242979 bytes

which lpd
/usr/sbin/lpd

ps -auwwx | grep lpd
root 22980  0.0  0.0 11184  2368  -  SsJ  15:57   0:00.00 /usr/sbin/lpd

The contents of /etc/printcap include this (do not do this - put everything on one line) :
Code:
np4172|Lexmark MS711dn:sd=/var/spool/lpd/np4172:\
  lf=/var/log/lpd_errors:\
  rm=np4172.hamilton.harte-lyne.ca:\
  rp=printers/np4172.hamilton.harte-lyne.ca:sh:

And the remote hostname resolves correctly:
[root@sshpipe-2 ~]# ping np4172.hamilton.harte-lyne.ca
PING np4172.hamilton.harte-lyne.ca (192.168.216.52): 56 data bytes
64 bytes from 192.168.216.52: icmp_seq=0 ttl=253 time=20.823 ms
64 bytes from 192.168.216.52: icmp_seq=1 ttl=253 time=0.526 ms
64 bytes from 192.168.216.52: icmp_seq=2 ttl=253 time=0.507 ms
^C
[/CODE]

And lpc status all shows this:
Code:
[root@sshpipe-2 ~]# lpc status all
lp:
    queuing is enabled
    printing is enabled
    no entries in spool area
    printer idle
np4174:
    queuing is enabled
    printing is enabled
    no entries in spool area
    printer idle
np4173:
    queuing is enabled
    printing is enabled
    no entries in spool area
    printer idle
np4172:
    queuing is enabled
    printing is enabled
    2 entries in spool area
    printer idle

When I restart the printer I get:
Code:
[root@sshpipe-2 ~]# lpc restart np4172
np4172:
    no daemon to abort
    printing enabled
    daemon restarted

I would like to discover which bits of this I have missed or misconfigured. Why does lpc not find the lpd daemon; and why are the print jobs stalled in the queue?
 
Do you have cups installed? If so, it pollutes the original Berkeley lpr/lpd name space with binaries in the /usr/local tree:
Code:
[strand.482] sudo find /usr -mount -name lpr -o -name lpd -o -name lpc -o -name lpq -o -name lprm                  <
/usr/local/libexec/cups/backend/lpd
/usr/local/bin/lprm
/usr/local/bin/lpr
/usr/local/bin/lpq
/usr/local/sbin/lpc
/usr/bin/lpq
/usr/bin/lprm
/usr/bin/lpr
/usr/libexec/lpr
/usr/sbin/lpc
/usr/sbin/lpd
I suspect that the composition of your PATH is causing you to invoke a mix of incompatible print spooler commands.
Try using rooted paths to all the commands, like /usr/sbin/lpc.
If this works, install aliases for the commands you want to use in your favourite shell.
 
Both systems have cups installed. I am aware of the difference between /usr/bin/lp* and /usr/local/bin/lp*.

I discovered the cause of the problem and it had nothing to do with cups. The issue was I had made multi-line entries in the /etc/printcap file for the printer definitions. When I concatenated each of these into one line entries the problem with lpd went away.

This notwithstanding the examples given in the default /etc/printcap file. I thought that the problem with the muli-line printcap entries might be my preference for soft-tabs (two spaces) in place of hard tabs ( ^I). But replacing the soft-tabs with actual tab characters did not resolve the issue. Only putting everything on one line worked. Through all of this chkprintcap never uttered a word of complaint.
 
You miss the colon
The contents of /etc/printcap include this (do not do this - put everything on one line) :
Code:
np4172|Lexmark MS711dn:sd=/var/spool/lpd/np4172:\
lf=/var/log/lpd_errors:\
rm=np4172.hamilton.harte-lyne.ca:\
rp=printers/np4172.hamilton.harte-lyne.ca:sh:

Rich (BB code):
np4172|Lexmark MS711dn:sd=/var/spool/lpd/np4172:\
   :lf=/var/log/lpd_errors:\
   :rm=np4172.hamilton.harte-lyne.ca:\
   :rp=printers/np4172.hamilton.harte-lyne.ca:sh:
 
Back
Top