Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Aug 1997 21:14:44 -0500 (CDT)
From:      "Lee Crites (AEI)" <leec@adam.adonai.net>
To:        Studded <Studded@dal.net>
Cc:        FreeBSD Questions <FreeBSD-Questions@FreeBSD.ORG>
Subject:   Re: Possible cron bug
Message-ID:  <Pine.BSF.3.95.970811210952.8175A-100000@adam.adonai.net>
In-Reply-To: <199708112231.PAA19729@mail.san.rr.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.970811210952.8175A-100000>