Well, it was just a guess. :) I tested against my 'named' daemon, using the
code you supplied and it works fine.
same code works fine for my AV daemon, but not for the MTA daemon

 What version of FreeBSD?
4.5

Are you using
the 'stock' shell?
yes

 Did you look at the output from grep to see what you get?
I forgot to mention, "I'm blue in the face"

How about splitting the test onto more than one line so that you can echo
and then test the status code.
done that  :))

ps -aux | grep -i "^root.*master"
STATUS=$?
echo "got $STATUS"
if [ $STATUS = 0 ] ; then
here's what I get from the command line:

ps -aux | grep -i "^root.*master"
STATUS=$?
echo "got $STATUS"
if [ $STATUS = 0 ] ; then

#if ( ps aux | grep -qi "^root.*master" )
#then
#echo "then: exit code equal 0"
exit 0
else

gives:

# /usr/local/bin/watchdog.sh
root 48701 0.0 0.9 1012 572 ?? Is 5:01PM 0:02.30 /usr/libexec/postfix/master
got 0

... but your version, or my multiple versions, have never mishaved from the command line, it's running from crontab that does comes out inverted.

IŽll see what happens in 10 min with next crontab run

thanks

Len


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message

Reply via email to