Bug 2368

Summary: lpd hangs if printer is turned off, and print jobs are pending
Product: [Retired] Red Hat Linux Reporter: pere
Component: lprAssignee: Crutcher Dunnavant <crutcher>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 5.2CC: dan, jon, multisupport, per.starback, tomc
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-08-27 20:03:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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
   off
 - 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
once.

I can be reached at 281-922-4222 ex 134 or email me at
jon

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'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
lpr-0.36.

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...