From 6695957284364e91c83f013086dd6aaa7b9efb4f Mon Sep 17 00:00:00 2001 From: Hendrik Jäger Date: Wed, 20 Apr 2022 14:06:19 +0200 Subject: initial --- files/usr/local/bin/s6-svscanboot | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 files/usr/local/bin/s6-svscanboot (limited to 'files/usr') diff --git a/files/usr/local/bin/s6-svscanboot b/files/usr/local/bin/s6-svscanboot new file mode 100644 index 0000000..7a5f549 --- /dev/null +++ b/files/usr/local/bin/s6-svscanboot @@ -0,0 +1,33 @@ +#!/bin/execlineb -S1 + +foreground { redirfd -w 2 /dev/null mkdir -p /run/uncaught-logs } +if { chown s6-logs:s6-logs /run/uncaught-logs } +if { chmod 2700 /run/uncaught-logs } +foreground { redirfd -w 2 /dev/null mkdir -p ${1}/.s6-svscan ${1}/s6-svscan-log } +foreground { redirfd -w 2 /dev/null ln -sf /bin/false ${1}/.s6-svscan/crash } +if +{ + redirfd -w 1 ${1}/.s6-svscan/finish + heredoc 0 "#!/bin/execlineb -P\ns6-svc -x -- \"${1}/s6-svscan-log\"\n" + cat +} +if { chmod 0755 ${1}/.s6-svscan/finish } +foreground { redirfd -w 2 /dev/null mkfifo -m 0600 ${1}/s6-svscan-log/fifo } +if +{ + redirfd -w 1 ${1}/s6-svscan-log/run + heredoc 0 "#!/bin/execlineb -P +redirfd -w 2 /dev/console +redirfd -rnb 0 fifo +s6-setuidgid s6-logs +exec -c +s6-log t /run/uncaught-logs\n" + cat +} +if { chmod 0755 ${1}/s6-svscan-log/run } + +redirfd -r 0 /dev/null +redirfd -wnb 1 ${1}/s6-svscan-log/fifo +fdmove -c 2 1 +s6-svscan -- ${1} + -- cgit v1.2.3