luci-0.8: Merge r4470
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 4 May 2009 20:05:18 +0000 (20:05 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 4 May 2009 20:05:18 +0000 (20:05 +0000)
contrib/package/freifunk-watchdog/src/watchdog.c
contrib/package/freifunk-watchdog/src/watchdog.h

index 12d4badec35fc0ed3059d06f42211e9725528ddd..b431b6dae4d643516d454c6541875e7cb623e267 100644 (file)
@@ -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);      
                }
 
index d11396f807f2524a181915f5753202b96e6238b4..7de24210a682a7631d773d25c27dc71f92960439 100644 (file)
@@ -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"