[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Executing a file only on later passes
From: |
Wheeler, John |
Subject: |
RE: Executing a file only on later passes |
Date: |
Fri, 24 Oct 2003 14:59:08 -0500 |
If you don't actually use the 2nd pass (honestly I haven't found a
single use for this, I'd be interested to see if anyone has) you could
recompile the code to just have a single pass. I've done this and it
makes writing and debugging automation much simpler.
openlog(VPREFIX,LOG_PID|LOG_NOWAIT|LOG_ODELAY,LOG_USER);
CheckSystemVariables();
SetReferenceTime(false); /* Reset */
DoTree(1,"Main Tree");
/* DoTree(2,"Main Tree"); */
DoAlerts();
SummarizeObjects();
closelog();
return 0;
}
"cfagent.c" line 195 of 1948 --10%-- col 1
I made this modification in 2.0.6.
> -----Original Message-----
> From: Chip Seraphine [mailto:chip@trdlnk.com]
> Sent: Friday, October 24, 2003 2:36 PM
> To: cfengine
> Subject: Executing a file only on later passes
>
>
> I have a file called cf.finish that performs some cleanup and
> notification tasks that I only want done absolutely dead last, so that
> all the other actions have a chance to set various classes. It is
> imported last from cfagent.conf.
>
> Unfortunately, -d2 output shows that it executes before the second
pass
> is performed for many of the other imported files. This causes
> cf.finish to miss a lot of things it needs to be able to see.
>
> I don't see any kind of 'pass1' or 'pass2' hardclasses being set
(which
> makes sense, as cfengine doesn't like to unset classes, making a 'pass
> flag' class unwieldy). So how should I do this? What method will
> safely guarantee that the contents of an imported file will only
execute
> on the second pass?
>
> Thanks,
>
> -c
>
> "I had a falling out with God. I wanted the Cubs to win the World
> Series and he wanted them to continue to suck." - Andy Richter
>
>
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-cfengine