Forum: CFEngine Help
Subject: Re: random executions or unpredictable file editing
Author: random
Link to topic: https://cfengine.com/forum/read.php?3,21763,22903#msg-22903

I am experiencing the same problem you are when modifying a file.

>From time to time, the file will either be only partially populated or it will 
>be completely blank.  I'm executing cf-execd -F from cron every 5 minutes.  
>I've tried to modify the executor control to execute cf-agent with -v and 
>added -v to cf-execd in cron, unfortunately when I do this the problem goes 
>away.  It seems to be some type of quantum anomaly.  Perhaps Q is involved.

Have you had any luck figuring out what was causing the inconsistencies?


...
      "${homedir}/wordfile"
         edit_line => update_wordlist("${wordlist}"),
         perms => mog("640", "${user}", "users"),
         create => "true",
         classes => if_repaired("wordlist_$(class_uid)");
...

bundle edit_line update_wordlist(wordlist) {
   vars:
      "words" slist => splitstring("$(wordlist)",",","100");

   # delete all the lines from the file.  this happens in memory.
   delete_lines:
      ".*";

   insert_lines:
      "Word $(words)";

}


_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to