A different solution would be to use delete_select and delete_if_not_match_from_list to eliminate the lines you don't want, then insert the ones you do. I am not saying this is better, but if you see different results (like, the problem doesn't "just happen" any more), then that'd help narrow down the bug...
Also, if you ran Cfengine with verbose logging enabled (see http://www.cfengine.org/manuals/cf3-reference.html#verbose-in-agent and/or loglevel in http://www.cfengine.org/manuals/cf3-reference.html#action-in-_002a) then you might have a detailed log of one of the times it fails... -Dan On Mar 14, 2011, at 1:31 PM, David Lee wrote: > Using 3.1.4 community on CentOS 5.5. > > I'm writing a bundle to maintain the set of "server" lines in > "/etc/ntp.conf". The cleanest way seems to be for that bundle to delete > the lines and re-insert them. Almost invariably the result should be > identical (no change) and so cfengine3 will detect this and correctly > skip taking any action. > > But sometimes it fails inexplicably. It is random, intermittent; I > cannot generate it at will; it "just happens". > > The "delete_lines" gets obeyed, but the "insert_lines" seems not to > happen, so it generates an unwanted change, deleting but failing to > re-insert those lines. Ouch. (A subsequent run will then successfully > do both the delete and the insert and will restore the file to what it > had been (and to how it should have stayed as permanently). > > Since this time on Friday (three days ago) it has generated 14 unwanted > "break and later repair" incidents, even though the cfengine3 config was > completely static. > > > Any clues? > > (Note: whether or not this really is the cleanest way to do achieve this > maintenance of "ntp.conf" is a different issue, and one which would take > us back to a recent conversation about a CPAN-like collection of > commonly needed things, written in a "best practice" way. But that is a > different issue from this random, intermittent, failure. I suggest that > we stay on this failure in this thread, and not get sidetracked onto the > CPAN/best-practice question.) > > If this is a known bug, that's OK; just let me known its status, please. > > > -- > : David Lee > : ECMWF (Data Handling System) > : Shinfield Park > : Reading RG2 9AX > : Berkshire > : > : tel: +44-118-9499 362 > : email: david....@ecmwf.int > _______________________________________________ > Help-cfengine mailing list > Help-cfengine@cfengine.org > https://cfengine.org/mailman/listinfo/help-cfengine _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine