help-cfengine
[Top][All Lists]
Advanced

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

Re: Need help with cfengine 2.0.2 editfiles/ReplaceAll


From: Bas van der Vlies
Subject: Re: Need help with cfengine 2.0.2 editfiles/ReplaceAll
Date: Fri, 4 Oct 2002 10:09:54 +0200

Why not use one of the following functions in editfiles:
  BeginGroupIfNoLineContaining quoted-string
  BeginGroupIfNoLineMatching quoted-regex

  BeginGroupIfNoLineContaining root:VoMhjHORJ/Ops:11856::::::
    ReplaceAll "^root.*" With "root:VoMhjHORJ/Ops:11856::::::"
  EndGroup


Just a thought.

On Fri, 4 Oct 2002 08:49:26 +0200 (MET DST)
Mark.Burgess@iu.hio.no wrote:

> 
> Cfengine is telling you that this rule will never stop. It will perform
> an edit every time cfengine runs, which is contrary to the idea of
> stable config. To force it through once, you can make the regexp you
> search for NOT match the string you replace with somehow, but I can't
> think how in your case at the moment.
> 
> There should probably be an option to force this once only. 
> I shall think about this perhaps someone else has a suggestion.
> 
> 
> Mark
> 
> On  3 Oct, Shoemaker, Paul A. wrote:
> > Hello!
> > 
> > I am trying to upgrade from 1.6.3 to 2.0.2 of cfengine.  But cfagent
> > is doing something that has caught me by surprise.
> > 
> > I've got the following coded:
> > editfiles:
> >    sparc.!restricted::
> >       { /etc/shadow
> >          Inform "true"
> >          ReplaceAll "^root.*" With "root:VoMhjHORJ/Ops:11856::::::"
> >       }
> > 
> > This has worked fine under cfengine 1.6.3.
> > 
> > But when I run the 2.0.2 cfagent, with the options -v -q, I get the
> > following:
> > Begin editing /etc/shadow
> > Checking for replace/^root:.*/root:VoMhjHORJ/Ops:11856::::::
> > cfengine:sixap06w: WARNING: Non-convergent edit ReplaceAll
> > [root:VoMhjHORJ/Ops:11856::::::] With [^root:.*]
> > cfengine:sixap06w: Line begins [root:74Q5zDNWiXKx2:11962::::::]
> > cfengine:sixap06w: Replace contains search string - edit was not done
> > cfengine:sixap06w: Error editing file /etc/shadow
> > 
> > For some reason the warning appears to be reversing the search string and
> > the replacement string, and the edit isn't being performed at all.
> > 
> > This is happening on a SPARCstation 20 (sun4m) running Solaris 8.  I built
> > cfengine 2.0.2 on another sun4m machine running Solaris 6.
> > 
> > Any help with why the ReplaceAll is failing would be appreciated.
> > Thanks!
> > 
> > 
> > 
> > _______________________________________________
> > Help-cfengine mailing list
> > Help-cfengine@gnu.org
> > http://mail.gnu.org/mailman/listinfo/help-cfengine
> 
> 
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Work: +47 22453272            Email:  Mark.Burgess@iu.hio.no
> Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> 
> 
> 
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-cfengine


--
********************************************************************
*                                                                  *
*  Bas van der Vlies                     e-mail: basv@sara.nl      *
*  SARA - Academic Computing Services    phone:  +31 20 592 8012   *
*  Kruislaan 415                         fax:    +31 20 6683167    *
*  1098 SJ Amsterdam                                               *
*                                                                  *
********************************************************************




reply via email to

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