From 96c4451b1a6bfb704fe633ac0d5bf594199ea25d Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 4 May 2009 20:05:18 +0000 Subject: [PATCH] luci-0.8: Merge r4470 --- contrib/package/freifunk-watchdog/src/watchdog.c | 6 ++++-- contrib/package/freifunk-watchdog/src/watchdog.h | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/contrib/package/freifunk-watchdog/src/watchdog.c b/contrib/package/freifunk-watchdog/src/watchdog.c index 12d4badec..b431b6dae 100644 --- a/contrib/package/freifunk-watchdog/src/watchdog.c +++ b/contrib/package/freifunk-watchdog/src/watchdog.c @@ -318,16 +318,18 @@ static int do_daemon(void) /* Wifi restart required? */ - if( restart_wifi > 0 ) + if( restart_wifi >= HYSTERESIS ) { restart_wifi = 0; + syslog(LOG_WARNING, "Restarting wireless"); EXEC(WIFI_ACTION); } /* Cron restart required? */ - if( restart_cron > 0 ) + if( restart_cron >= HYSTERESIS ) { restart_cron = 0; + syslog(LOG_WARNING, "Restarting crond process"); EXEC(CRON_ACTION); } diff --git a/contrib/package/freifunk-watchdog/src/watchdog.h b/contrib/package/freifunk-watchdog/src/watchdog.h index d11396f80..7de24210a 100644 --- a/contrib/package/freifunk-watchdog/src/watchdog.h +++ b/contrib/package/freifunk-watchdog/src/watchdog.h @@ -39,6 +39,9 @@ /* Check interval */ #define INTERVAL 30 +/* Hysteresis */ +#define HYSTERESIS 3 + /* How to call myself in the logs */ #define SYSLOG_IDENT "Freifunk Watchdog" -- 2.25.1