diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2026-04-30 14:58:50 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska-skaware@skarnet.org> | 2026-04-30 14:58:50 +0000 |
| commit | 43394581bb3106633c8802b378a7f2e6e53b352a (patch) | |
| tree | 62457069eb1d61d0b548a3eb37e8604195766250 | |
| parent | fc99eb8a237d50f7973c951b8b1109f1fd62c92d (diff) | |
| download | s6-linux-init-43394581bb3106633c8802b378a7f2e6e53b352a.tar.gz | |
Change stage 4 commands to use external prefix
If you are using slashpackage or an equivalent full-versioned
fs hierarchy, if you upgrade s6-l-i, delete the old package, do
not restart the s6-linux-init-shutdownd service, and reboot,
shutdownd will create a stage 4 script using old full-versioned
paths, and your reboot will fail in stage 4, which is very bad
since nothing is running anymore so recovery is impossible.
(Destructors should never fail.)
To prevent that from happening, use non-versioned paths to s6-l-i
commands in stage 4.
| -rw-r--r-- | src/shutdown/s6-linux-init-shutdownd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shutdown/s6-linux-init-shutdownd.c b/src/shutdown/s6-linux-init-shutdownd.c index de7b093..33b7dda 100644 --- a/src/shutdown/s6-linux-init-shutdownd.c +++ b/src/shutdown/s6-linux-init-shutdownd.c @@ -190,12 +190,12 @@ static inline void prepare_stage4 (char const *basedir, char what) if (buffer_puts(&b, "#!" EXECLINE_SHEBANGPREFIX "execlineb -P\n\n" EXECLINE_EXTBINPREFIX "foreground { " - S6_LINUX_INIT_BINPREFIX "s6-linux-init-umountall }\n" + S6_LINUX_INIT_EXTBINPREFIX "s6-linux-init-umountall }\n" EXECLINE_EXTBINPREFIX "foreground { tryexec { ") < 0 || !string_quote(&satmp, basedir, strlen(basedir)) || buffer_put(&b, satmp.s + sabase, satmp.len - sabase) < 0 || buffer_puts(&b, "/scripts/" STAGE4 " } }\n" - S6_LINUX_INIT_BINPREFIX "s6-linux-init-hpr -f -") < 0 + S6_LINUX_INIT_EXTBINPREFIX "s6-linux-init-hpr -f -") < 0 || buffer_put(&b, &what, 1) < 0 || buffer_putsflush(&b, "\n") < 0) strerr_diefu2sys(111, "write to ", STAGE4_FILE ".new") ; |
