Bug 35147

Summary: daemon function --check option broken
Product: [Retired] Red Hat Linux Reporter: Russell Steffen <rsteffen>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: rvokal
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: 2001-04-08 00:22:44 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 Russell Steffen 2001-04-08 00:22:41 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.2.17-14enterprise i686)


When the daemon function attempts to determine if a program is already
running, it calls the pidofproc() function with the name of the executable
it's about to run (in $1) instead of the name passed in with the --check
option (in $base). This makes the --check option effectively
non-functional. This option worked correctly in Red Hat 6.2.

Reproducible: Always
Steps to Reproduce:
I came across this while setting up to run 2 instancess of BIND, each
listening to different interfaces. I set up a second config file that 
specified that the pid should be stored in /var/run/named-external.pid. I
then copied the /etc/init.d/named file, altered the damon line to look
like:
daemon --check named-external named -c /etc/named-external.conf

The result was that it would not start if the original named was running,
but started correctly if the original named was shut down. The is because
the daemon function was looking for the existance of /var/run/named.pid
instead of /var/run/named-external.pid.

Comment 1 Bill Nottingham 2001-07-11 01:16:02 UTC
This is fixed in 6.00-1.