Commit a15aa00d authored by nextime's avatar nextime

Add debug logging to watchdog monitoring loops

- Add detailed logging to main() monitoring loops
- Track loop iterations and daemon status checks
- Log sleep intervals and monitoring status
- Help diagnose why watchdog exits prematurely
- Fixed both wssshd and wssshc watchdogs
parent 299eed2b
......@@ -205,7 +205,13 @@ main() {
log_message "Check interval: $CHECK_INTERVAL seconds"
log_message "Max restarts: $MAX_RESTARTS per $RESTART_WINDOW seconds"
log_message "Entering monitoring loop"
local loop_count=0
while true; do
loop_count=$((loop_count + 1))
log_message "Monitoring loop iteration $loop_count"
if ! is_daemon_running; then
log_message "$DAEMON_NAME is not running"
......@@ -226,8 +232,11 @@ main() {
log_message "Watchdog exiting due to daemon restart failure"
break
fi
else
log_message "$DAEMON_NAME is running, monitoring continues"
fi
log_message "Sleeping for $CHECK_INTERVAL seconds"
sleep "$CHECK_INTERVAL"
done
......
......@@ -200,7 +200,13 @@ main() {
log_message "Check interval: $CHECK_INTERVAL seconds"
log_message "Max restarts: $MAX_RESTARTS per $RESTART_WINDOW seconds"
log_message "Entering monitoring loop"
local loop_count=0
while true; do
loop_count=$((loop_count + 1))
log_message "Monitoring loop iteration $loop_count"
if ! is_daemon_running; then
log_message "$DAEMON_NAME is not running"
......@@ -221,8 +227,11 @@ main() {
log_message "Watchdog exiting due to daemon restart failure"
break
fi
else
log_message "$DAEMON_NAME is running, monitoring continues"
fi
log_message "Sleeping for $CHECK_INTERVAL seconds"
sleep "$CHECK_INTERVAL"
done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment