From bc77187b8d2140eb46ec8b7557858557b26a44ee Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 22 Jun 2020 13:29:03 +0000 Subject: Don't test for shutdown.allow in containers --- src/init/s6-linux-init-maker.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/init') diff --git a/src/init/s6-linux-init-maker.c b/src/init/s6-linux-init-maker.c index 9ad8302..35beb3e 100644 --- a/src/init/s6-linux-init-maker.c +++ b/src/init/s6-linux-init-maker.c @@ -226,10 +226,14 @@ static int runleveld_script (buffer *b, char const *data) static int sig_script (buffer *b, char const *option) { - return put_shebang(b) - && buffer_puts(b, S6_LINUX_INIT_EXTBINPREFIX "s6-linux-init-shutdown -a ") >= 0 - && buffer_puts(b, option) >= 0 - && buffer_puts(b, " -- now\n") >= 0 ; + if (!put_shebang(b) + || buffer_puts(b, S6_LINUX_INIT_EXTBINPREFIX "s6-linux-init-shutdown ") < 0) + return 0 ; + if (!inns && buffer_puts(b, "-a ") < 0) return 0 ; + if (buffer_puts(b, option) < 0 + || buffer_puts(b, " -- now\n") < 0) + return 0 ; + return 1 ; } static inline int stage1_script (buffer *b, char const *data) -- cgit v1.2.3