Jim,
Saw a post that you were beinning to roll 0.99.3..

Here is a short patch that will enable mon to reload/reread the
configuration file whenever it's modification timestamp has changed:

--- mon.orig    Tue Jan  6 15:17:51 2004
+++ mon Tue Jan  6 15:23:51 2004
@@ -361,6 +361,25 @@
     $tm = time;

     #
+    # For each loop of the main daemon, re-check the
+    # config file for changes, reload if necessary
+    #
+    my $config_file_mod_time = (stat($CF{"CF"}))[9]; # modification time
+    if (length($CF{"CONF_MOD_TIME"}) == 0) { # not set
+         $CF{"CONF_MOD_TIME"} = $config_file_mod_time;
+         syslog ("notice", "reloading config ".$CF{"CF"});
+         &reset_server;
+    } elseif ($config_file_mod_time > $CF{"CONF_MOD_TIME"}) {
+         #
+         # If the current mod time of the config file is
+         # greater than the stored config time...
+         #
+         $CF{"CONF_MOD_TIME"} = $config_file_mod_time;
+         syslog("notice", "reloading config ".$CF{"CF"});
+         &reset_server;
+    }
+
+    #
     # step through the watch groups, decrementing and
     # handing expired timers
     #

-- 

Christopher R Key
-----
"We sleep safe in our beds because rough men stand ready in the night to
visit violence on those who would do us harm"
                           -- George Orwell


_______________________________________________
mon mailing list
[EMAIL PROTECTED]
http://linux.kernel.org/mailman/listinfo/mon

Reply via email to