K 10 svn:author V 6 alfred K 8 svn:date V 27 2013-01-19T06:04:26.701078Z K 7 svn:log V 1286 Add code to watchdog to time the watchdog command program, carp when the program takes too long. The purpose of this is to allow system integrators to tune their watchdogs and get advanced notice if they are behaving poorly. The following facilities are added: - Warn if the watchdog program takes too long. - Disable activation of the system watchdog so that one can test the watchdogd script without potentially rebooting the system. - Ability to log to syslog when scripts begin to timeout. The following changes are included: - When told to measure time, do not unconditionally nap for 'sleep' seconds, instead adjust the naptime by the elapsed time so as not to trigger the watchdog. Example: /usr/trees/head/usr.sbin/watchdogd # ./watchdogd -d -n -w -e "sleep 1" watchdogd: mlockall failed: Cannot allocate memory watchdogd: Watchdog program: 'sleep 1' took too long: 1.010894 seconds >= 1 seconds threshhold watchdogd: Watchdog program: 'sleep 1' took too long: 1.010636 seconds >= 1 seconds threshhold watchdogd: Watchdog program: 'sleep 1' took too long: 1.010700 seconds >= 1 seconds threshhold ^C /usr/trees/head/usr.sbin/watchdogd # ./watchdogd -d -n -w -e "sleep 0.9" watchdogd: mlockall failed: Cannot allocate memory ... doesn't complain ... END