From owner-freebsd-questions Sun Nov 24 15:25:14 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 800A937B401 for ; Sun, 24 Nov 2002 15:25:12 -0800 (PST) Received: from mgw1-out.MEIway.com (mgw1.meiway.com [212.73.210.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id A4B8D43E6E for ; Sun, 24 Nov 2002 15:25:11 -0800 (PST) (envelope-from LConrad@Go2France.com) Received: from VirusGate.MEIway.com (virus-gate.meiway.com [212.73.210.91]) by mgw1-out.MEIway.com (Postfix Relay Hub) with ESMTP id EBC47EF6A5 for ; Mon, 25 Nov 2002 00:25:05 +0100 (CET) Received: from localhost (localhost.meiway.com [127.0.0.1]) by VirusGate.MEIway.com (Postfix) with SMTP id 905685D009 for ; Mon, 25 Nov 2002 00:25:14 +0100 (CET) Received: from mail.Go2France.com (ms1.meiway.com [212.73.210.73]) by VirusGate.MEIway.com (Postfix) with ESMTP id 555705D008 for ; Mon, 25 Nov 2002 00:25:14 +0100 (CET) Received: from tx0-go2france-c.Go2France.com [193.252.44.38] by mail.Go2France.com with ESMTP (SMTPD32-6.06) id A25744940236; Mon, 25 Nov 2002 00:35:51 +0100 Message-Id: <5.1.1.6.2.20021125002134.02d7ade8@mail.go2france.com> X-Sender: LConrad@Go2France.com@mail.go2france.com X-Mailer: QUALCOMM Windows Eudora Version 5.1.1 Date: Mon, 25 Nov 2002 00:25:07 +0100 To: freebsd-questions@freebsd.org From: Len Conrad Subject: Re: .sh interactive ok, from crontab, not In-Reply-To: References: <5.1.1.6.2.20021124234729.02d7a030@mail.go2france.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; format=flowed Content-Transfer-Encoding: quoted-printable Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >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