Bug 2368 - lpd hangs if printer is turned off, and print jobs are pending
Summary: lpd hangs if printer is turned off, and print jobs are pending
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: lpr
Version: 5.2
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Crutcher Dunnavant
QA Contact:
: 2416 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 1999-04-26 11:25 UTC by pere
Modified: 2008-05-01 15:37 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 1999-08-27 20:03:59 UTC

Attachments (Terms of Use)

Description pere 1999-04-26 11:25:29 UTC
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.

Comment 1 Bill Nottingham 1999-05-24 20:22:59 UTC
*** 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!

Comment 2 Tom Cross 1999-05-24 20:30:59 UTC
I had these exact problems until I upgraded to lpr-0.36 on
notting@redhat.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

Comment 3 Daniel Rogers 1999-07-31 00:01:59 UTC
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.

Comment 4 Preston Brown 1999-08-27 20:03:59 UTC
this has been resolved by lpd 0.36 and later.

Comment 5 M Glass 2001-04-27 14:47:49 UTC
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...

Note You need to log in before you can comment on or make changes to this bug.