…led reboot shows where (engine#3287)
The 22 Nov plain reboot of the installed c35 sat 3 min 24 s in rc.shutdown (two shutdown markers, 19:57:55Z and
20:01:19Z) with nothing in the kernel log after eno1: Link is Down, and no pstore record. Nothing said which step.
1bit-shutdown-watch <pid> (embed, /usr/local/bin) follows rc.shutdown's process tree once a second and writes one
kernel-log line per step, plus state, wchan and kernel stack for a step still running after 10/20/40 s; it raises the
console log level to 7 and lifts the /dev/kmsg rate limit for the rest of the shutdown. hook-rc-shutdown.sh starts it
from rc.shutdown right after the Executing banner; container-build.sh runs the hook on the skeleton (and refuses a
packed rc.shutdown without it), cut.sh BASE mode on the base's copy. tests/shutdown_watch_test.sh (14 checks) runs the
watcher on a real process tree with a file for the kernel log, and the hook on rc.shutdown's banner lines.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Part of #3287, item 1: make the frozen reboot observable.
Why: the plain reboot of the installed c35 on 22 Nov (orchestrator GO; evidence in the #3287 comment) sat 3 min 24 s in rc.shutdown. The old boot has two
shutdownmarkers, at 19:57:55Z and 20:01:19Z. Nothing reached the kernel log aftereno1: Link is Down, and pstore held nothing. Nothing said which step it was in.Change:
embed/usr/local/bin/1bit-shutdown-watch <pid>follows rc.shutdown's process tree once a second, down to the command it is waiting on. It writes one kernel-log line whenever that changes (1bit-shutdown: step <pid> <command line>). A step still running after 10, 20, 40 s… gets its state, wchan and kernel stack.printk_devkmsg=on(userspace kmsg is otherwise rate-limited) and console log level 7 (the appliance boots at 1).1bit-logs snap(which is how the 22 Nov stall was read) and the efi-pstore record (os/v3/puppy: every reboot leaves its kernel log tail in EFI pstore, and the next boot files it (engine#3287) #3306).printfper line, so one record each. busybox ash'sset -xwrites a trace line in pieces; I measured that on the box.killzombiesanswers a transient zombie by killing its parent.hook-rc-shutdown.sh <rc.shutdown>adds one backgrounded line after woof-CE'sExecuting /etc/rc.d/rc.shutdown...banner. It is idempotent and refuses a file without the banner.container-build.shruns it on the skeleton and refuses a packed rc.shutdown without the hook;1bit-shutdown-watchjoins the in-image list.cut.shBASE mode runs it on the base SFS's rc.shutdown, in a separate hunk from os/v3/puppy/cut.sh: a BASE cut reads the RTC as UTC too (engine#3308 follow-up, engine#3287) #3329.tests/shutdown_watch_test.shis registered as ctestshutdown_watch.Measured:
tests/shutdown_watch_test.sh: 14/14 under dash withenv -i(as CI runs it, unprivileged, no hardware), and 14/14 under busybox ash. It runs ~5 s on a real process tree, with a file standing in for the kernel log. It does not skip; there is no skip path./dev/kmsg;ONEBIT_KMSGset so the live printk settings were left alone): dmesg shows1bit-shutdown: still in 426826 sleep 3 after 2 s, state S, wchan hrtimer_nanosleep, then the stack lines ([<0>] hrtimer_nanosleep+0x8a/0x100…), thenrc.shutdown 426825 finished. Each is one record.busybox ash -npasses on the hooked file.bash scripts/pre-pr-checks.sh --base origin/main: 17 green, 3 skipped.Not run: a real shutdown with the hook. That needs an image with it plus a reboot of the appliance, which is the next GO.
🤖 Generated with Claude Code