monit-general
[Top][All Lists]
Advanced

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

Re: Reset time patch


From: Martin Pala
Subject: Re: Reset time patch
Date: Fri, 28 Feb 2014 16:40:09 +0100

Hi Rory,

i think hardcoded time-driven spurious Monit reload could be dangerous ... 
let's say the user does some change to Monit configuration, which will contain 
syntax error and before he'll check the syntax with -t option (and fix), Monit 
will be automatically reloaded due to time step, which will effectively kill it 
when the configuration parsing will fail. 

The reload trigger should not be part of Util_getProcessUptime() function ... 
it just gets the process uptime based on the file timestamp and is called in 
several places in the HTTP interface and in the XML interface - it can also be 
called for any file and the caller doesn't necessarily need to unintentionally 
reload monit when he just tries to get the uptime.

The test also doesn't handle the case, where the time jumps back (for example 
by 10 years).

Reloading Monit may also not be the action the user wants if such case happens 
- in some cases it may be better to for example call ntpdate to set the time 
instead of reloading Monit.

I think it may be better to just add custom "check program" script with system 
time test to Monit configuration.

Regards,
Martin



On 27 Feb 2014, at 21:34, Rory Toma <address@hidden> wrote:

> Attached is a patch that will re-init monit if the timestamp of the monit 
> pidfile is older than the uptime of the system and you have sysinfo.
> 
> This is useful on embedded systems that may not have a battery backed clock, 
> as when the time is set, the system can jump forward 40 years.
> <uptime-patch.txt>--
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general




reply via email to

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