On Fri, Aug 19, 2005 at 03:45:42PM -0700, Klaus wrote:
> while [ ! -f /tmp/cfsuccess ]
> do
>     ( cfagent --define __CLASS__ --define __NAME__ --file
> /var/cfengine/inputs/cfsetup.conf && touch /tmp/cfsuccess ) &
>     sleep 60
>     killall cfagent
> done
> 
> Is there a way to extract a PID out of cfengine while it runs? That
> would make the kind of code loop used above less dodgy.

Couldn't you just do something like this?

while ! cfagent --define __CLASS__ --define __NAME__ --file 
/var/cfengine/inputs/cfsetup.conf; do
    echo cfagent failed
done

Why put cfagent in the background, just to kill it later? Wouldn't this
potentially zap your cfagent before it was done every time, creating an
infinite loop? It would probably happen after some time, when you start
doing something that takes a long time on the initial run.

-- 
Knut Auvor Grythe
ITEA Systemdrift


_______________________________________________
Help-cfengine mailing list
Help-cfengine@gnu.org
http://lists.gnu.org/mailman/listinfo/help-cfengine

Reply via email to