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() { ...@@ -205,7 +205,13 @@ main() {
log_message "Check interval: $CHECK_INTERVAL seconds" log_message "Check interval: $CHECK_INTERVAL seconds"
log_message "Max restarts: $MAX_RESTARTS per $RESTART_WINDOW seconds" log_message "Max restarts: $MAX_RESTARTS per $RESTART_WINDOW seconds"
log_message "Entering monitoring loop"
local loop_count=0
while true; do while true; do
loop_count=$((loop_count + 1))
log_message "Monitoring loop iteration $loop_count"
if ! is_daemon_running; then if ! is_daemon_running; then
log_message "$DAEMON_NAME is not running" log_message "$DAEMON_NAME is not running"
...@@ -226,8 +232,11 @@ main() { ...@@ -226,8 +232,11 @@ main() {
log_message "Watchdog exiting due to daemon restart failure" log_message "Watchdog exiting due to daemon restart failure"
break break
fi fi
else
log_message "$DAEMON_NAME is running, monitoring continues"
fi fi
log_message "Sleeping for $CHECK_INTERVAL seconds"
sleep "$CHECK_INTERVAL" sleep "$CHECK_INTERVAL"
done done
......
...@@ -200,7 +200,13 @@ main() { ...@@ -200,7 +200,13 @@ main() {
log_message "Check interval: $CHECK_INTERVAL seconds" log_message "Check interval: $CHECK_INTERVAL seconds"
log_message "Max restarts: $MAX_RESTARTS per $RESTART_WINDOW seconds" log_message "Max restarts: $MAX_RESTARTS per $RESTART_WINDOW seconds"
log_message "Entering monitoring loop"
local loop_count=0
while true; do while true; do
loop_count=$((loop_count + 1))
log_message "Monitoring loop iteration $loop_count"
if ! is_daemon_running; then if ! is_daemon_running; then
log_message "$DAEMON_NAME is not running" log_message "$DAEMON_NAME is not running"
...@@ -221,8 +227,11 @@ main() { ...@@ -221,8 +227,11 @@ main() {
log_message "Watchdog exiting due to daemon restart failure" log_message "Watchdog exiting due to daemon restart failure"
break break
fi fi
else
log_message "$DAEMON_NAME is running, monitoring continues"
fi fi
log_message "Sleeping for $CHECK_INTERVAL seconds"
sleep "$CHECK_INTERVAL" sleep "$CHECK_INTERVAL"
done 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