[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Conditional restart
From: |
Alexander Mattausch |
Subject: |
RE: Conditional restart |
Date: |
Thu, 13 Feb 2003 22:00:18 +0100 |
We had this question yesterday...
> -----Original Message-----
> From:
> help-cfengine-bounces+alexander.mattausch=physik.uni-erlangen.
de@gnu.org [mailto:help-cfengine->
bounces+alexander.mattausch=physik.uni-erlangen.de@gnu.org]
> On Behalf Of Manon Goo
> Sent: Thursday, February 13, 2003 9:46 PM
> To: help-cfengine@gnu.org
> Subject: Conditional restart
>
>
> Hello,
>
> Is there an solution to condition the restart of a service ?
> I would like
> to copy (and edit) the syslog.conf and postfix config from a
> central host
> an only restart syslog and config if syslogd.conf changes. I
> would only
> like to restart postfix if main.cf or master.cf is changed
Here is the answer:
Paul Heinlein schrieb:
>Yeah, it's pretty simple. Here's how I handle an analogous situation
>with ntp configuration updates on our Red Hat Linux clients. When the
>config is updates, I define a class called 'restartntp,' which is
>merely calls Red Hat's init script in restart mode.
>
> copy:
> linux.redhat.ntp_pclient::
> $(master_configs)/ntp/ntp.conf.linux
> server=$(policyhost) dest=/etc/ntp.conf
> m=444 o=root g=root type=sum define=restartntp
>
> shellcommands:
> linux.redhat.restartntp::
> "/etc/init.d/ntpd restart"
>
and don't forget
control:
AddInstallable = ( restartntp )
Regards,
Alex