contrib/package: introduce hysteresis in watchdog
This commit is contained in:
parent
970fe52726
commit
34f8367c78
2 changed files with 7 additions and 2 deletions
|
@ -318,16 +318,18 @@ static int do_daemon(void)
|
||||||
|
|
||||||
|
|
||||||
/* Wifi restart required? */
|
/* Wifi restart required? */
|
||||||
if( restart_wifi > 0 )
|
if( restart_wifi >= HYSTERESIS )
|
||||||
{
|
{
|
||||||
restart_wifi = 0;
|
restart_wifi = 0;
|
||||||
|
syslog(LOG_WARNING, "Restarting wireless");
|
||||||
EXEC(WIFI_ACTION);
|
EXEC(WIFI_ACTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cron restart required? */
|
/* Cron restart required? */
|
||||||
if( restart_cron > 0 )
|
if( restart_cron >= HYSTERESIS )
|
||||||
{
|
{
|
||||||
restart_cron = 0;
|
restart_cron = 0;
|
||||||
|
syslog(LOG_WARNING, "Restarting crond process");
|
||||||
EXEC(CRON_ACTION);
|
EXEC(CRON_ACTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,9 @@
|
||||||
/* Check interval */
|
/* Check interval */
|
||||||
#define INTERVAL 30
|
#define INTERVAL 30
|
||||||
|
|
||||||
|
/* Hysteresis */
|
||||||
|
#define HYSTERESIS 3
|
||||||
|
|
||||||
/* How to call myself in the logs */
|
/* How to call myself in the logs */
|
||||||
#define SYSLOG_IDENT "Freifunk Watchdog"
|
#define SYSLOG_IDENT "Freifunk Watchdog"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue