help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Non-convergent use of ReplaceAll


From: Thomas Bellman
Subject: Non-convergent use of ReplaceAll
Date: Mon, 26 Jul 2004 10:36:38 +0000 (UTC)
User-agent: nn/6.6.3

I am (late, I know) trying to switch from Cfengine 1.6.3 to
2.1.6, but I have some problems with several of my editfiles
declarations that are using ReplaceAll.  For instance, I have
the following editfiles declaration:

editfiles:
    redhat.YpMaster::
        { /etc/sysconfig/yppasswdd

            SetCommentStart '#'
            BeginGroupIfNoLineMatching  '.*PASSWDFILE=.*'
                Append  '#PASSWDFILE='
            EndGroup
            UnCommentLinesMatching      '.*PASSWDFILE=.*'
            ReplaceAll                  '^PASSWDFILE=.*'
                  With                  'PASSWDFILE=/etc/ypfiles/passwd'

            DefineClasses       'RestartYppasswdd'
        }

I want to make sure there is a line "PASSWDFILE=/etc/ypfiles/passwd",
but if a, possibly commented, assignment to PASSWDFILE already exists,
I don't want to move it.  This is actually just a cosmetic wish; in
the default file coming with the OS, there are comments describing the
parameter, and I would like the assignment to stay together with those
comments.

This worked fine in Cfengine 1.6.3, but in 2.1.6 I get the error
message:

cfengine:: WARNING: Non-convergent edit operation ReplaceAll 
[PASSWDFILE=/etc/ypfiles/passwd] With [^PASSWDFILE=.*]
cfengine:: Line begins [PASSWDFILE=/etc/ypfiles/passwd]
cfengine:: Replacement matches search string and will thus replace every time - 
edit was not done
cfengine:: Error editing file /etc/sysconfig/yppasswdd

Why is this ReplaceAll operation deemed to be non-convergent?  I
can't think of any circumstances where it would not be.


-- 
Thomas Bellman,   Lysator Computer Club,   Linköping University,  Sweden
"Beware of bugs in the above code; I have    !  bellman @ lysator.liu.se
 only proved it correct, not tried it."      !  Make Love -- Nicht Wahr!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]