If I do "/etc/rc.d/init.d/sendmail status", it reports (at least) three PIDs. I think it catches 'grep' and 'sh' PIDs, besides sendmail's own.
Date: Wed, 3 Mar 1999 00:44:21 -0300 (CLST) From: Alvaro Herrera <alvherre> To: bugzilla Subject: BUG #1406 [ The following text is in the "ISO-8859-1" character set. ] [ Your display is set for the "US-ASCII" character set. ] [ Some characters may be displayed incorrectly. ] This patch (applied to /etc/rc.d/init.d/functions) should fix it: --- functions.orig Wed Mar 3 00:43:42 1999 +++ functions Thu Feb 25 02:18:30 1999 @@ -128,7 +128,9 @@ return 0 else - pid=`ps auxww | grep '[^[]'$1 | awk '{print $2}'` + pid=`ps auxww | grep '[^]/]'$1 | awk '{print $2}'` echo $procs if [ "$pid" != "" ] ; then echo "$1 (pid $pid) is running..." -- "Lo esencial es invisible para los ojos" (A. de Saint Exzpery) Alvaro Herrera (alvherre)
I have verified this to be true in our test lab. [root@test80 /root]# /etc/rc.d/init.d/sendmail status sendmail (pid 291 1965 1968 1970 1971) is running... [root@test80 /root]#ps -aux | grep sendmail warning: `-' deprecated; use `ps aux', not `ps -aux' root 291 0.0 1.4 1404 920 ? S Mar 8 0:00 sendmail: accepting c [root@test80 /root]#
this has been fixed in a later initscripts release.