help-cfengine
[Top][All Lists]
Advanced

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

Re: editfiles


From: David Kewley
Subject: Re: editfiles
Date: Mon, 19 Apr 2004 15:55:16 -0700
User-agent: KMail/1.5

Brendan Strejcek wrote on Monday 19 April 2004 15:26:
> David Kewley wrote:
> > Brendan Strejcek wrote on Monday 19 April 2004 13:41:
> > > David Kewley wrote:
> > > >         HashCommentLinesMatching "[^#]*StrictModes.*$"
> > > >         AppendIfNoSuchLine "StrictModes no"
> > >
> > > Not good:
> >
> > ...
> >
> > > You might need to do log rotation on your config files...
> >
> > How about this then? :)
> >
> >     DeletetLinesMatching "[^#]*StrictModes.*$"
> >     AppendIfNoSuchLine "StrictModes no"
>
> Still suboptimal. If you have contingent actions (such as restarting
> sshd) your classes defined with DefineClasses will always fire.

What you say makes sense for the general case.  Again, in my case it works 
because I'm not using DefineClasses.  Rather, I take the pristine sshd_config 
from the openssh-server rpm, edit it, then copy it into place using checksum, 
and do a define=restart_sshd in the copy section.  It only restarts sshd if 
the edited sshd_config is different from the current live file; in that case 
the edited sshd_config is copied in and sshd is restarted.

David




reply via email to

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