Bug 12295

Summary: Bug in /etc/rc.d/init.d/functions not starting daemon
Product: [Retired] Red Hat Linux Reporter: Chris Bitmead <chris>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED WORKSFORME QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2CC: djh, 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: 2000-06-15 09:59:58 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 Chris Bitmead 2000-06-15 09:59:55 UTC
If you write an init.d script to start a daemon - let's say it's 
the foobar daemon, you will generally write an init script
/etc/rc.d/init.d/foobar.

Now /etc/rc.d/init.d/functions uses /sbin/pidof to try and figure out if
the daemon is already running. But now the initscript is called
foobar and the daemon is called foobar. pidof always returns true
because it confuses the fact that the initscript foobar is running
with whether the daemon foobar is running. Thus the daemon is never
started because it thinks it is already running. This didn't seem to be a
problem in RH 6.1.

To make matters more confusing running "sh /etc/rc.d/init.d/foobar" seems
to work, whereas "/etc/rc.d/initd/foobar" does not work. Who knows why.

The solution is to make sure if pidof returns a pid, make sure it is not
the pid of the init script itself. This may or may not be easy if
the daemon function is run in the background, it may not have access to the
old pid. But something needs to be done. At a very bare minimum report the
reason it's not going to run the daemon and preferably document the bug in
the script if it can't be fixed.

Comment 1 Bill Nottingham 2000-08-07 05:18:09 UTC
This appears to be fixed in the pinstripe beta; I can't
reproduce it here.