help-cfengine
[Top][All Lists]
Advanced

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

Re: editfiles problem - revisited - Still nobody having an idea what goe


From: Jamie Wilkinson
Subject: Re: editfiles problem - revisited - Still nobody having an idea what goes wrong?
Date: Mon, 6 Sep 2004 15:40:39 +1000
User-agent: Mutt/1.5.6+20040803i

This one time, at band camp, Sven Mueller wrote:
>In short my problem was that I _need_ to restart a program if I changed 
>it's config file. But for various reasons, I have to avoid restarting 
>it, if I didn't change it.

I'm not sure what your problem is.  editfiles doesn't actually change the
file if there are no changes to make, and doesn't define any of the
DefineClasses either.

If your editfiles script is convergent, then it will just work.

editfiles:

{ /etc/foo
BeginGroupIfNoLineMatching '^foo:.*'
Append 'foo:'
EndGroup
ResetSearch '1'
LocateLineMatching '^foo:.*'
BeginGroupIfNoMatch '^foo:bar:quux'
ReplaceLineWith 'foo:bar:quux'
EndGroup
DefineClasses 'foo_restart'
}

shellcommands:

foo_restart::

  "/etc/init.d/foo restart" useshell=dumb

-- 
jaq@spacepants.org                           http://spacepants.org/jaq.gpg



reply via email to

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