help-cfengine
[Top][All Lists]
Advanced

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

Re: Restart on if something changed?


From: Luis Cerezo
Subject: Re: Restart on if something changed?
Date: Thu, 26 Jan 2006 10:59:20 -0600
User-agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929)

Paul,

What I did was to use DefineClasses in the editfiles section. this sets the class only if the file is edited..

eg..

linux::
                        { /etc/ssh/sshd_config
ReplaceAll "#Banner /some/path" With "Banner /etc/issue"
                        DefineClasses  "HUPsshd"
                        }
       shellcommands:

               linux.HUPsshd::

                       "/sbin/service sshd restart"    useshell=false

this would only run the shellcommands if the class is defined, and that only happens if the file is edited. you could then add the time.class.hup doo-hickie and all should be well..

hth.

-luis


PAUL WILLIAMSON wrote:

How can I tell a process to restart only if a certain file has changed?

We just changed the way our login banners are supposed to occur.
Before, they appeared prior to login, so I could just use the sshd_config file and specify an banner in the file. Now, I need to present the banner after login. In order to do this, I need to restart sshd. But, I don't want to restart sshd during the middle of the day or when the sshd_config file hasn't changed.

Paul



_______________________________________________
Help-cfengine mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-cfengine

--
Luis E. Cerezo






reply via email to

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