On Wed, Dec 01, 2010 at 08:42:58AM -0500, no-re...@cfengine.com wrote:
>Forum: Cfengine Help
>Subject: Should it take two cf-agent runs before a change on policyhost is 
>implemented on client?
>Author: sdodier
>Link to topic: https://cfengine.com/forum/read.php?3,19530,19530#msg-19530
>
>Implementing changes to a cfengine 3 (cf3) client takes two cf-agent runs.
>
>ISSUE:
>In my particular setup of cf3, I am running cf-serverd on my policyhost, and 
>cf-agent in the crontab on the clients.  When I run cf-agent on the client, it 
>takes two runs before the change that I've made in my policyhost's repository 
>to be implemented on the cf3 client.  The first run completes all promises 
>that are local to the computer running the cf-agent at the same time as it 
>copies the changes from the policyhost's repository.  The second run will do 
>the same as the first, but during this second run the changes from my 
>repository are now local to the client running cf-agent, and they are 
>implemented as promised.  The point being that if my crontab is set to run 
>hourly, it will take two hours before a change is actually imposed on the 
>client running the cf-agent. 
>
>QUESTION:
>Is it normal that it takes two runs before a change is imposed on a cf3 client?

Yes.  This is the whole 'convergence' thing, since the first run of the 
policy to run will update the files in client:/var/cfengine/inputs/, and
the second run will actualy implement the changes in the newly updated
files.

>If not, how can I make the sync between the policyhost's repository and the 
>client running the cf-agent happen first before the promises are imposed?

I've found this problem annoying enough that when not using cf-execd, I just 
run cf-agent twice:

        cf-agent -BK
        cf-agent -KI

The first run updates only the failsafe.cf policy, while the 2nd run
does all of it.  I've found it handy to make aliases for both.

If you do run cf-execd, you could also use this as your "exec_command"
string:

        body executor control {
                # Instead of a separate update script, now do this
                exec_command => "$(sys.workdir)/bin/cf-agent -f failsafe.cf && 
$(sys.workdir)/bin/cf-agent";
        }


-- 
Jesse Becker
NHGRI Linux support (Digicon Contractor)
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to