Forum: Cfengine Help
Subject: execd -F doesnt seem to run cfagent
Author: heruux
Link to topic: https://cfengine.com/forum/read.php?3,20731,20731#msg-20731

Hi, I'm trying out cfengine 3 for the first time and I'm having some trouble 
understanding how to configure things. I set up a policy server using the 
quick-start guide, and created a basic file to install some packages and put 
these in the masterfiles directory (with the slightly modified default files 
from /usr/local/share/doc/cfengine/inputs/).

My client machines are set up through preseed with the script shown below 
running in the late_command (after downloading the files.). This seems to work 
well, the machines install cfengine3 and then runs the agent which successfully 
installs the specified packages.


apt-get -y install db4.6-util openssl
dpkg -i /root/cfengine-community_3.1.4-1_ubuntu10_amd64.deb
cp  /usr/local/share/doc/cfengine/inputs/*cf /var/cfengine/inputs/
rm /var/cfengine/inputs/update.cf
wget 10.0.0.3/update.cf -O /var/cfengine/inputs/update.cf
/usr/local/sbin/cf-agent -v --bootstrap
/usr/local/sbin/cf-agent -v


The main problem I'm having is that when I modify the file for installing 
packages in the masterfiles directory on the policy server, the files are 
copied over to the client's input folder, but it doesnt seem like the files are 
executed anymore.

When running crontab -l I get the following output:

0,5,10,15,20,25,30,35,40,45,50,55 * * * * /var/cfengine/bin/cf-execd -F


The way I understand it, this should run cf-execd every 5 minutes, which in 
turn should run cf-agent through the line

exec_command => "$(sys.workdir)/bin/cf-agent -f failsafe.cf && 
$(sys.workdir)/bin/cf-agent";

under body executor control in my promises.cf file.

By using ps aux | grep cf- I can see that monitord and serverd are running for 
a while after the cron job runs.

My promises.cf file: http://pastebin.com/iKRTUB3w
The packages (install.cf): http://pastebin.com/LTngbQ6S

Other files in the inputs directory is site.cf, update.cf and failsafe.cf (I 
don't think I've modified these much except adding the policy server copying 
thing in update.cf).

Note: When I run cf-agent manually, it runs and installs the packages that 
werent already installed just fine.

Another thing I've been looking for solutions for is how I could automate the 
key-exchange between the automatically installed client machines and the main 
server, so that I don't have to trust all keys from all networks.

Thanks in advance for any input on this.

_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to