Red Hat Bugzilla – Bug 35147
daemon function --check option broken
Last modified: 2014-03-16 22:20:13 EDT
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.
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.
This is fixed in 6.00-1.