Description of problem: __pids_pidof() function in /etc/rc.d/init.d/functions fails to return the pid if the process has a different root directory. Version-Release number of selected component (if applicable): initscripts-8.31.1-1 How reproducible: Always Steps to Reproduce: 1. Issue command "service thttpd start" 2. Issue command "service thttpd status" 3. Observe bogus message "thttpd dead but pid file exists" Actual results: The __pids_pidof() in /etc/rc.d/init.d/functions sometimes fails to return the pid of a process. Failures happen when the process has a different root directory. This will ALWAYS be true with some services, for example thttpd, since it does a chroot() !! Expected results: The function __pids_pidof() should always work. Additional info: The function looks like this: # Output PIDs of matching processes, found using pidof __pids_pidof() { pidof -c -o $$ -o $PPID -o %PPID -x "$1" || \ pidof -c -o $$ -o $PPID -o %PPID -x "${1##*/}" } The cause of the problem is the '-c' option which causes the pidof command to only return process ids that are running with the same root directory. Is that **really** necessary? Why was that explicitly done? If you get rid of the option (as per RHEL3 & 4) it will work always.
There is a same problem in initscripts-8.35-1.1
> Why was that explicitly done? To avoid incorrect matches with services running in chroot installations. Rawhide versions also check whether the PID specified in the PID file exists before concluding the process is dead, not only (pidof) results. > There is a same problem in initscripts-8.35-1.1 Can you recheck, please? This is a duplicate of #182623, which was supposed to be fixed in initscripts-8.32. It seems to work correctly with initscripts-8.36-1 and thttpd-2.25b-11.fc6.
Closing, no response.