--
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to help-cfengine+unsubscribe@googlegroups.com.
To post to this group, send email to help-c...@googlegroups.com.
Visit this group at http://groups.google.com/group/help-cfengine.
For more options, visit https://groups.google.com/d/optout.
On Wed, Apr 1, 2015 at 10:18 PM, Neil Watson <cfen...@watson-wilson.ca> wrote:On Wed, Apr 01, 2015 at 10:03:37PM +0200, Natxo Asenjo wrote:
# install cfengine agents
yum install -y cfengine-community
# bootstrap it
/var/cfengine/bin/cf-agent --bootstrap 192.168.5.1 >
/root/bootstrapped.txt 2>&1
This should populate policy_server.dat. It not, then the bootstrap must
have failed
On Wed, Apr 1, 2015 at 10:18 PM, Neil Watson <cfen...@watson-wilson.ca> wrote:On Wed, Apr 01, 2015 at 10:03:37PM +0200, Natxo Asenjo wrote:
# install cfengine agents
yum install -y cfengine-community
# bootstrap it
/var/cfengine/bin/cf-agent --bootstrap 192.168.5.1 >
/root/bootstrapped.txt 2>&1
This should populate policy_server.dat. It not, then the bootstrap must
have failedyes, agreed. But it fails every time, that's why I resorted to creating the file like that.
--
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to help-cfengin...@googlegroups.com.
Interesting; this appears to be exactly the way we install/bootstrap cfengine, and we don't have any issues:rpmkeys --import http://cfengine.com/pub/gpg.keycat <<EOF >/etc/yum.repos.d/cfengine-community.repo[cfengine-repository]name=CFEngineenabled=0gpgcheck=1EOFrestorecon -R /etc/yum.repos.dyum -y install cfengine-community/var/cfengine/bin/cf-agent --bootstrap <policy-server>I assume they are both going through the cfe_internal_update, but I'm not positive.
--
So, this is old, but I tracked down the issue.This was working for us just fine for a long time, then I updated the masterfiles to their latest (3.7.x tag) in preparation for testing and rolling out 3.7. You note in the log above that systemctl is complaining about being in a chroot environment. As best as I can tell, the installation of the RPM causes a "systemctl (re)start cfengine3" (the first chroot error we see), and then the bootstrap process calls cf-agent -f update.cf, which in turn calls systemctl restart cfengine3 (because it's still not running).This is all fine, because we're in a installation/pre-first-boot environment and don't need cfengine running. However, it appears to me that the "cf-agent -f update.cf" fails due to that command failing. As a consequence, the bootstrap appears to fail, because the update run failed, even though all files are copied, etc. Thus, we also found that creating the policy_server.dat file fixed our problems.
Having said that, is there any good path to fix this? I imagine this is a common enough scenario to warrant some kind of upstream handling? I tried to run "cf-agent -N systemd --bootstrap ...", but that of course would not unset a hard class. The simplest (conceptually) solution would be to have a class one could set when running in such an environment that would get cf-agent to not attempt to restart the systemd service. Or perhaps reduce the bootstrap process to NOT run cf-agent -f update.cf. As long as it gets enabled, it's ok, right?
If an upstream fix isn't deemed appropriate, however, I guess we could continue to manually create our policy_server.dat files, or use the %post section to create a "first boot" type script that does all of this in a non-chroot environment.