Bug 35147 - daemon function --check option broken
Summary: daemon function --check option broken
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 7.0
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2001-04-08 00:22 UTC by Russell Steffen
Modified: 2014-03-17 02:20 UTC (History)
1 user (show)

Clone Of:
Last Closed: 2001-04-08 00:22:44 UTC

Attachments (Terms of Use)

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

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