Detect host reboot via boot_id instead of probing tmux #164

Closed
opened 2026-09-03 23:05:15 +01:00 by naps62-yolo · 0 comments
Collaborator

The daemon cannot currently tell a restart of itself (tmux still running, sessions adoptable) from a host reboot (tmux gone, nothing adoptable). Both look like "some sessions were not in tmux list-sessions", so the logs say nothing useful and the daemon probes tmux for sessions that provably cannot exist.

Record /proc/sys/kernel/random/boot_id in the state directory on startup. If the stored value differs from the current one, every session from the previous boot is known dead: skip the tmux probe for them, mark them dormant directly, and log one line naming the count — "host rebooted, N sessions dormant" — instead of silently listing zero.

Missing or unreadable boot_id (non-Linux, restricted /proc) falls back to today's behaviour rather than failing startup.

The daemon cannot currently tell a restart of itself (tmux still running, sessions adoptable) from a host reboot (tmux gone, nothing adoptable). Both look like "some sessions were not in `tmux list-sessions`", so the logs say nothing useful and the daemon probes tmux for sessions that provably cannot exist. Record `/proc/sys/kernel/random/boot_id` in the state directory on startup. If the stored value differs from the current one, every session from the previous boot is known dead: skip the tmux probe for them, mark them dormant directly, and log one line naming the count — "host rebooted, N sessions dormant" — instead of silently listing zero. Missing or unreadable `boot_id` (non-Linux, restricted `/proc`) falls back to today's behaviour rather than failing startup.
naps62-yolo added this to the Reboot resilience milestone 2026-09-03 23:05:15 +01:00
naps62-yolo added the area/daemondifficulty/easytype/feat labels 2026-09-03 23:05:15 +01:00
naps62-yolo added a new dependency 2026-09-03 23:06:12 +01:00
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Reference: naps62/maestro#164