Bug 15680 - wrong pid file
Summary: wrong pid file
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: LPRng   
(Show other bugs)
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Crutcher Dunnavant
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-08-07 21:00 UTC by mal
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-08-07 23:50:11 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description mal 2000-08-07 21:00:54 UTC
LPRng creates a pid file as 
/var/run/lpd.printer
This is incorrect. 
All scripts from /etc/rc.d/init.d/functions
are looking for a file
/var/run/lpd.pid
Change process file name to a standard one.

Comment 1 Crutcher Dunnavant 2000-08-07 23:03:58 UTC
I see the issue, but I cannot find the pid code.
Will fix later.

Comment 2 mal 2000-08-07 23:50:10 UTC
It uses lockfile.port lock file format.
grep on Lockfile_DYN
grep Lockfile_DYN src/*/*
and in all places where 
path = safestrdup3( Lockfile_DYN,".", Lpd_port_DYN, __FILE__, __LINE__ );
replace Lpd_port_DYN to "pid"

Comment 3 Crutcher Dunnavant 2000-08-08 20:23:28 UTC
There is to much magic associated with this file for me to want to touch it
right before a release.
Specifically, what happens if there are more than one spooler (which is posible
with LPRng).
I will send a request to the upstream maintainer on this, but I'm closing it for
now, as it's control script does some other magic to find the pid.

Comment 4 mal 2000-08-08 20:37:58 UTC
The replacement of Lpd_port_DYN to "pid"
will work fine while you have 
lpd working with a single port (printer=515).
The Lpd_port_DYN is just a string "printer"
when printer port is 515, or string
representing port number otherwise.

The program will not work if one started
two or more lpd which sit on different ports.
But from /etc/rc.d/init/lpd 
you can not do this anyway.

doing 
grep Lockfile_DYN  src/*/* 
src/common/checkpc.c:	if( Lockfile_DYN == 0 ){
src/common/checkpc.c:		path = safestrdup3( Lockfile_DYN,".", Lpd_port_DYN,
__FILE__, __LINE__ ); 
src/common/lpd.c:	if( Lockfile_DYN == 0 ){
src/common/lpd.c:	path = safestrdup3( Lockfile_DYN,".", Lpd_port_DYN, __FILE__,
__LINE__ );
src/common/lpd.c:	path = safestrdup3( Lockfile_DYN,".", Lpd_port_DYN, __FILE__,
__LINE__ );
src/common/vars.c:{ "lockfile", STRING_K, &Lockfile_DYN,1,0,"=" LOCKFILE},
src/include/lp.h:EXTERN char* Lockfile_DYN;

There are 3 places affected:
two in lpd.c 
and one in checkpc.c





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