Red Hat Bugzilla – Bug 2368
lpd hangs if printer is turned off, and print jobs are pending
Last modified: 2008-05-01 11:37:50 EDT
Using RedHat 5.2 and lpr 0.33.
During reboot, and when ever lpd is started, lpd will hang
without collecting print jobs, if the following is true:
- One of the network printers in /etc/printcap is turned
- There is print jobs waiting to be sent to this printer
After reading thru the source, I discovered that lpd will
try to empty the queue before starting to receive new print
jobs. If one of the printers is down, it will never make
contact with it, and lpd will hang forever.
*** Bug 2416 has been marked as a duplicate of this bug. ***
I have several systems running 5.2 RH Linux on an Intel
platform and it seems that the systems which have remote
printers configured on them have problems bringin the lpd
services back online after a shutdown.
I have noticed several articles on this while searching the
FAQs but there does not seem to be a solution for it.
Here is what I find when I reboot one of these systems if i
go out and look for all the lpd processes I find the
current process and the previous process still hanging out
there. If I go into the /var/spool/lpd/ directory and more
out the lpd.lock file it still contains the old PID from
the previous boot. If i remove this file and kill all the
lpd processes and remove any hung print jobs and then
restart the lpd process and run <lpc restart> on the
printers it seems to be fine. I have hacked the lpd script
in /etc/rc.d/init.d and have it removing the lpd.lock file
when the system is shutdown and have it doing an extra
killproc on all lpd processes when the system starts back
up and this seemed to work on one clien's system but only
I can be reached at 281-922-4222 ex 134 or email me at
Thank you for your time!
I had these exact problems until I upgraded to lpr-0.36 on
email@example.com's web page. I had trouble with lpr-0.36 running on
my RedHat 5.2 box, but it appears to work just fine in RedHat 6.0 with
Also, it attempts to contact the remote lpds before listening on its
port and socket. This means that if two systems print to each other
and both reboot at the same time, neither lpd will come back up.
this has been resolved by lpd 0.36 and later.
This bug still exists/has resurface in the latest lpr-0.50-(4 to 7.6.x) package
for RH 6.2.
The problem is that if a printer is down, the startup() procedure never returns
because it is blocking on waitpid(). The child process never exits because it
keeps getting a network error (host unreachable) that causes it to continually
retry. Thus the two listening sockets are not created, noone prints, etc...