From owner-freebsd-questions Mon Aug 11 19:16:14 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id TAA17394 for questions-outgoing; Mon, 11 Aug 1997 19:16:14 -0700 (PDT) Received: from adam.adonai.net (adam.adonai.net [205.182.92.2]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id TAA17385 for ; Mon, 11 Aug 1997 19:16:11 -0700 (PDT) Received: from localhost (leec@localhost) by adam.adonai.net (8.8.5/8.7.3) with SMTP id VAA08227; Mon, 11 Aug 1997 21:14:44 -0500 (CDT) Date: Mon, 11 Aug 1997 21:14:44 -0500 (CDT) From: "Lee Crites (AEI)" To: Studded cc: FreeBSD Questions Subject: Re: Possible cron bug In-Reply-To: <199708112231.PAA19729@mail.san.rr.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Mon, 11 Aug 1997, Studded wrote: =>#!/bin/sh => =>/bin/ps -ax | /usr/bin/grep [a]djkerntz => =>if [ $? != 0 ]; then => /sbin/adjkerntz -i & ^^^ =>fi => =>exit Add the "&" as I put above. What is happening is the cron job itself is hanging around until adjkerntz exits. Telling it to execute in the background (via the '&') allows the shell script to complete, thus making the two (not really) zombie tasks also go away. You could also use the -c option to grep, like this: #!/bin/csh -f if ( "`/bin/ps -ax | /usr/bin/grep -c [a]djkerntz`" == "0") then /sbin/adjkerntz -i & endif I personally like the count option better, but everyone has his/her own quirks... Lee