diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2020-11-30 18:27:41 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2020-11-30 18:27:41 +0000 |
commit | 2fa0acdd248c006270010196ad02e530d8ab09ea (patch) | |
tree | 0c5f946f06a1c98d2a35c8eb350dc62d3e97a8ff /src/init/s6-linux-init-maker.c | |
parent | c1171b979c236ec2c486bc12e4866112a12b9a84 (diff) | |
download | s6-linux-init-2fa0acdd248c006270010196ad02e530d8ab09ea.tar.xz |
Adapt to skalibs-2.10.0.0 and s6-2.10.0.0
Diffstat (limited to 'src/init/s6-linux-init-maker.c')
-rw-r--r-- | src/init/s6-linux-init-maker.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/init/s6-linux-init-maker.c b/src/init/s6-linux-init-maker.c index f858e5f..1e6de62 100644 --- a/src/init/s6-linux-init-maker.c +++ b/src/init/s6-linux-init-maker.c @@ -125,20 +125,20 @@ static int container_crash_script (buffer *b, char const *data) S6_LINUX_INIT_EXTBINPREFIX "s6-linux-init-hpr -fnp\n") >= 0 ; } -static int container_exit_script (buffer *b, char const *results) +static int container_exit_script (buffer *b, char const *data) { - return put_shebang_options(b, "-S0") + (void)data ; + return put_shebang(b) && buffer_puts(b, - EXECLINE_EXTBINPREFIX "ifelse -X { test $1 = halt }\n{\n " - S6_EXTBINPREFIX "s6-envdir -- ") >= 0 - && buffer_puts(b, results) >= 0 - && buffer_puts(b, "\n " - EXECLINE_EXTBINPREFIX "importas -D0 -- EXITCODE exitcode\n " - EXECLINE_EXTBINPREFIX "exit $EXITCODE\n}\n" - EXECLINE_EXTBINPREFIX "ifte -X\n { " - S6_LINUX_INIT_EXTBINPREFIX "s6-linux-init-hpr -fnr }\n { " + S6_EXTBINPREFIX "s6-envdir -- " S6_LINUX_INIT_TMPFS "/" CONTAINER_RESULTS "\n" + EXECLINE_EXTBINPREFIX "multisubstitute\n{\n" + " importas -uD0 -- EXITCODE exitcode\n " + " importas -uDh -- HALTCODE haltcode\n}\n" + EXECLINE_EXTBINPREFIX "ifelse -X { test $HALTCODE = r } { " + S6_LINUX_INIT_EXTBINPREFIX "s6-linux-init-hpr -fnr }\n" + EXECLINE_EXTBINPREFIX "ifelse -X { test $HALTCODE = p } { " S6_LINUX_INIT_EXTBINPREFIX "s6-linux-init-hpr -fnp }\n" - "test $1 = reboot\n") >= 0 ; + EXECLINE_EXTBINPREFIX "exit $EXITCODE\n") >= 0 ; } static int s6_svscan_log_script (buffer *b, char const *data) @@ -573,8 +573,8 @@ static inline void make_image (char const *base) if (inns) { - auto_script(base, "run-image/" SCANDIR "/.s6-svscan/crash", &container_crash_script, "") ; - auto_script(base, "run-image/" SCANDIR "/.s6-svscan/finish", &container_exit_script, S6_LINUX_INIT_TMPFS "/" CONTAINER_RESULTS) ; + auto_script(base, "run-image/" SCANDIR "/.s6-svscan/crash", &container_crash_script, 0) ; + auto_script(base, "run-image/" SCANDIR "/.s6-svscan/finish", &container_exit_script, 0) ; auto_dir(base, "run-image/" CONTAINER_RESULTS, 0, 0, 0755) ; auto_file(base, "run-image/" CONTAINER_RESULTS "/exitcode", "0\n", 2) ; } |