[Top][All Lists]

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

Re: Restart daemon after config change

From: Chip Seraphine
Subject: Re: Restart daemon after config change
Date: Thu, 18 Dec 2003 09:58:30 -0600
User-agent: KMail/1.5

Kief Morris said:
>I want to find a way to restart daemons when their configuration files
>have been changed. I thought I might use file checksum monitoring
>to set a class (eg. "bind_needs_restart") that would later trigger
>a shellcommand to run the init script ("/etc/init.d/bind9 reload").

I ran into a similar obstacle, and just had to hack around it with a 
FileIsNewer.  The last thing I have cfagent do on each run is dump its 
classlist into a textfile (/var/cfengine/log/LASTRRUN), which is handy for 
debugging purposes.  Since I can assume that file has an mtime of the last 
cfengine run, I see if the config file has a newer timestamp than LASTRRUN 
and take appropriate action (generally activating a class that has processes: 
HUP or restart something).

 Alexander Mattausch wrote:
> Maybe it would be an idea to add another keyword like 'warn_define' in
> the code which defines a class whenever a warning is issued.

I'll second *that* motion.

reply via email to

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