Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Nov 2002 00:25:07 +0100
From:      Len Conrad <LConrad@Go2France.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: .sh interactive ok, from crontab, not
Message-ID:  <5.1.1.6.2.20021125002134.02d7ade8@mail.go2france.com>
In-Reply-To: <BA069CAD.14B28%pscott@skycoast.us>
References:  <5.1.1.6.2.20021124234729.02d7a030@mail.go2france.com>

next in thread | previous in thread | raw e-mail | index | archive | help

>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=3D$?
>echo "got $STATUS"
>if [ $STATUS =3D 0 ] ; then

here's what I get from the command line:

ps -aux | grep -i "^root.*master"
STATUS=3D$?
echo "got $STATUS"
if [ $STATUS =3D 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=20
/usr/libexec/postfix/master
got 0

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

I=B4ll see what happens in 10 min with next crontab run

thanks

Len


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5.1.1.6.2.20021125002134.02d7ade8>