help-cfengine
[Top][All Lists]
Advanced

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

editfiles template; multiple edits; setting a class on update


From: Atom Powers
Subject: editfiles template; multiple edits; setting a class on update
Date: Fri, 13 Jan 2006 09:23:15 -0800

I have a situation, many of them in fact, where I want to create a
template file, make multiple edits to it, and then restart a service
if the destination file is updated. How can I manage my editfiles
without restarting the service every time cfengine runs?

I could do my editfiles on "$(FileSource)/common/etc/inetd.conf"; but
then that file would be copied from the masterfiles server every time
cfengine runs.

How have you solved this problem?

For example:
I have a default inetd.conf file, with sshd in it.
--
copy::
        $(FileSource)/common/etc/inetd.conf
        dest=/etc/inetd.conf
        mode=664        owner=root      group=wheel
--
Some hosts run ftp, others run nntp:
--
editfiles:
  ftp-server::
        {  /etc/inetd.conf
        AppendIfNoSuchLine "ftp    stream  tcp nowait  root   
/usr/libexec/ftpd   ftpd -l"
       DefineClasses "newinetd"
       }

  nntp-server::
        {  /etc/inetd.conf
        AppendIfNoSuchLine "nntp   stream  tcp     nowait  news   
/usr/local/libexec/nntpd        nntpd"
       DefineClasses "newinetd"
       }
--
Then I restart inetd if the config file changed:
--
shellcommands:
  newinetd::
    "/etc/rc.d/inetd restart"
--

This will modify inetd.conf, and thus restart inetd, every time.


--
--
Perfection is just a word I use occasionally with mustard.
--Atom Powers--




reply via email to

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