summaryrefslogtreecommitdiff
path: root/src/init/s6-linux-init-maker.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-06-06 19:27:21 +0000
committerLaurent Bercot <ska@appnovation.com>2023-06-06 19:27:21 +0000
commit2a4e570485e8dee285843ca46f6dd6155972c437 (patch)
treeecb19738ece505d9d1d71e6891196345a3a907b8 /src/init/s6-linux-init-maker.c
parent392a1b8d4cfdb40812fa9434f06fd3ff73e39973 (diff)
downloads6-linux-init-2a4e570485e8dee285843ca46f6dd6155972c437.tar.xz
Add notification to shutdownd
This saves 1 second between stage 3 and stage 4. Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/init/s6-linux-init-maker.c')
-rw-r--r--src/init/s6-linux-init-maker.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/init/s6-linux-init-maker.c b/src/init/s6-linux-init-maker.c
index 98b9b46..d3b921d 100644
--- a/src/init/s6-linux-init-maker.c
+++ b/src/init/s6-linux-init-maker.c
@@ -186,7 +186,7 @@ static int shutdownd_script (buffer *b, char const *data)
size_t sabase = satmp.len ;
char fmt[UINT_FMT] ;
if (!put_shebang(b)
- || buffer_puts(b, S6_LINUX_INIT_EXTBINPREFIX "s6-linux-init-shutdownd -c ") < 0
+ || buffer_puts(b, S6_LINUX_INIT_EXTBINPREFIX "s6-linux-init-shutdownd -d3 -c ") < 0
|| !string_quote(&satmp, robase, strlen(robase))) return 0 ;
if (buffer_put(b, satmp.s + sabase, satmp.len - sabase) < 0) goto err ;
satmp.len = sabase ;
@@ -527,6 +527,7 @@ static inline void make_image (char const *base)
auto_dir(base, "run-image/" S6_LINUX_INIT_SCANDIR "/" SHUTDOWND_SERVICEDIR, 0, 0, 0755) ;
auto_fifo(base, "run-image/" S6_LINUX_INIT_SCANDIR "/" SHUTDOWND_SERVICEDIR "/" SHUTDOWND_FIFO) ;
+ auto_file(base, "run-image/" S6_LINUX_INIT_SCANDIR "/" SHUTDOWND_SERVICEDIR "/notification-fd", "3\n", 2) ;
auto_script(base, "run-image/" S6_LINUX_INIT_SCANDIR "/" SHUTDOWND_SERVICEDIR "/run", &shutdownd_script, 0) ;
if (inns)