[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: re understanding cfengine "passes"
From: |
rader |
Subject: |
Re: re understanding cfengine "passes" |
Date: |
Thu, 18 Mar 2004 05:14:06 -0600 |
> >This one time, at band camp, rader@ginseng.hep.wisc.edu wrote:
> >The cfagent --verbose output from my config says that cfengine is
> >doing two passes.
> From: Jamie Wilkinson
> cfagent always does two passes over the action sequence.
Ahh, cfagent sometimes makes only one pass in my neck of the woods...
$ cat cfCopy
#!/usr/sbin/cfagent -d2 --no-splay --inform --no-lock --file
control: actionsequence = ( copy )
copy: /tmp/a dest=/tmp/b type=mtime
$ rm /tmp/b && touch /tmp/a && ./cfCopy | grep "pass 1" | wc -l
1
$ rm /tmp/b && touch /tmp/a && ./cfCopy | grep "pass 2" | wc -l
0
> >Using...
> > addInstallable = ( has_afs )
> > import: afs.conf # defines has_afs
> > shellcommands:
> > has_afs:: "/bin/echo yes i have afs here"
> > !has_afs:: "/bin/echo no afs here"
> >...causes *both* shellcommands actions to be excuted (in other words:
> >causes another pass of doing shellcommands.) The cfagent --verbose
> >output says shellcommands is executed twice during the first pass.
> Mark can correct me if I'm wrong, but last I checked, the imports would
> be loaded and parsed *at the end* of the current file. So, your shell
> commands are being run before the contents of afs.conf get read.
Yes. The doc on import explains that.
> As to why both echos get executed, does -d2 give you any more hints
> about what classes are defined?
I'm pretty sure the AddInstallable tells cfengine to make another
pass on shellcommands: If I remove the AddInstallable line, then
all I get is "/bin/echo no afs here". The doc for AddInstallable
sorta eludes to the idea. Sorry, I should have mentioned that.
steve
- - -
systems & network guy
high energy physics
university of wisconsin