The status function included in the initscripts-3.78-1 file /etc/rc.d/init.d/functions seems to be broken. The command at line 130 checking for the pid of the passed process is: pid=`ps auxww | grep '[^[]'$1 | awk '{print $2}'` which finds several processes that aren't relevant (such at status itself). The old code I find in initscripts-3.67-1 is: pid=`ps auxww | grep $1 | egrep -v grep\|$0 | awk '{print $2}'` which works fine. I'm not sure I understand why non-relevant processes would have a '[' before the name, and hence why this change was implemented. I'm using the standard procps-1.2.9-2 for ps. Thanks, JD Smith
I have been unable to replicate this behaviour in the test lab.
This is a multi-task issue. The grep and/or other commands may actually be complete before ps looks for them. For instance: bash> ps auxw | grep '[^[]'boo will either show the grep[^[]boo or not, arbitrarily, when run on my machine. Just because the grep is after the ps in the pipe, this doesn't guarantee that it won't show up on the process table. And unless the expression '[^[]' somehow eliminates these unwanted processes, the script is broken. Note that the egrep -v in the old version performed this elimination. Thanks, JD
this has been fixed in a later version of initscripts.