Forum: Cfengine Help Subject: Cfengine3 stuck in infinite loop Author: ro Link to topic: https://cfengine.com/forum/read.php?3,20172,20172#msg-20172
Hello, I noticed the following behavior from Cfengine 3.0.5p1 till 3.1.2. Consider the following code: ##################################################################### # # promises.cf # ##################################################################### bundle common CfControl { vars: any:: "InputFiles" slist => { "cfengine_stdlib.cf", }; "BundleSequence" slist => { "Testing" }; } body common control { any:: inputs => { @(CfControl.InputFiles) }; bundlesequence => { @(CfControl.BundleSequence) }; } ##################################################################### bundle agent Testing { vars: any:: "apt_proxy_file" string => "/etc/apt/apt.conf.d/02proxy"; methods: any:: "any" usebundle => get_template("$(apt_proxy_file)","644"), comment => "Set a proxy for apt", classes => if_repaired("repaired_AptProxy"); reports: repaired_AptProxy:: "Repaired promise AptProxy"; } bundle agent get_template(file,mode) { files: any:: "$(file).staging" copy_from => local_cp("$(Dir.repository)/$(file)"), perms => mo("400","root"), comment => "Get the template"; "$(file)" edit_line => expand_template("$(file).staging"), perms => mo("$(mode)","root"), create => "true", comment => "Expand the template"; } Running this with cf-agent -K -v throws the following error: cf3 -> Promised file line "" exists within file /etc/apt/apt.conf.d/02proxy (promise kept) This line is repeated infinitely until aborted. Upon abort, these are the last lines shown from the cf-agent process: cf3 -> Promised file line "" exists within file /etc/apt/apt.conf.d/02proxy (promise kept)^Ccf3 -> Promised file line "" exists within file /etc/apt/apt.conf.d/02proxy (promise kept) !! Could not lock: 9cf3 Received signal 2 (SIGINT) while doing [] cf3 Logical start time Tue Jan 18 21:09:29 2011 cf3 This sub-task started really at Tue Jan 18 21:09:29 2011 cf3 Trying to remove lock - try cf3 Outcome of version (not specified) (agent-0): Promises observed to be kept 100%, Promises repaired 0%, Promises not repaired 0% Do you need any more information? Cheers, Robert _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine