Bug 11740
Summary: | Race condition in locking for LPD | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | jwilliam |
Component: | lpr | Assignee: | Crutcher Dunnavant <crutcher> |
Status: | CLOSED WONTFIX | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 6.2 | CC: | chris.ryan |
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: | 2000-10-11 15:27:26 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
jwilliam
2000-05-30 05:36:55 UTC
This is fixed in Rawhide - we're using LPRng from now on. This will have to be fixed, garh. This is what I ended up doing, based upon your comments. I reordered the code to reduce the time during which a deadlock might happen (though not by much). /* * search the spool directory for more work. */ nitems = getq(&queue); if (nitems == 0) { /* no more work to do */ done: flock(lfd,LOCK_UN); /* Unlock the lock now, to avoid deadlocks */ if (count > 0) { /* Files actually printed */ if (!SF && !tof) (void) write(ofd, FF, strlen(FF)); if (TR != NULL) /* output trailer */ (void) write(ofd, TR, strlen(TR)); } (void) close(ofd); (void) wait(NULL); (void) unlink(tempfile); exit(0); } else if (nitems < 0) { syslog(LOG_ERR, "%s: can't scan %s", printer, SD); exit(1); } goto again; I will close this when I push the Errata (which means QA and Docs has to sign off on it). Okay, if a more guaranteed fix is needed, I could add a spinlock file lock, but I dont really want to do that, for obvious reasons. So if you need this reopened, I guess we add the spin lock. Okay, we have a child bug: Bug #18853 It's contents: Having problem printing to network printers. The jobs hang in the queue. when running 'lpc stat <printername>' jobs show as waiting. When I run 'ps -ef |grep lpd' - 'lpd' shows as running more than once (usually twice). If I kill the second instance, the reports will occasionally print. Often it is a matter of a combination of killing the process, and trying 'lpc restart <printername>' or 'lpc down/up <printername>'. I have not found consistency in getting the reports to print. I had a file sent to me - lpr-0.50-7.i386.rpm - installed that. It seems to help a little, but we still have a problem. There are only 3 of 18 printers that get hung. They are all at the bottom in printtool, but were not to start. I deleted and re-added 2 of them. I have also swapped hardware on one of them. The 3 printers are HP laserjets - a model 4, 5, & 4050N. The 4050N has a built in network card, the other 2 are using NetGear PS104 print servers. I have them set up on linux as 'Remote Unix (lpd) queue', Remote Host is IP Address, Remote Queue is Raw. These printers also exist on the NT side. I actually set them up there first, to use the software with the printservers/network cards to assign the IP address to the devices. Then I create them on Linux. *** Bug 18853 has been marked as a duplicate of this bug. *** I will examine how to do more complete locking on lpr, but it wont be easy. The lpr-0.50-7 package is about the most that can easily be done to fix this, and anything more complete will take some serious thought to avoid creating NEW race condtions. I'm not going to get to this. |