X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=files%2Fusr%2Flocal%2Fbin%2Fs6-svscanboot.buster;fp=files%2Fusr%2Flocal%2Fbin%2Fs6-svscanboot.buster;h=ef6de1b3ec9fb07c57ee6393253d4e8e248a4d96;hb=c4bc0fecb2a92d8b713cac93cae7141b4b56a542;hp=0000000000000000000000000000000000000000;hpb=209272713d3e8e5adf0dd6e722e9cd0827a70aa1;p=user%2Fhenk%2Fcode%2Fpuppet%2Fmodules%2Fs6.git diff --git a/files/usr/local/bin/s6-svscanboot.buster b/files/usr/local/bin/s6-svscanboot.buster new file mode 100644 index 0000000..ef6de1b --- /dev/null +++ b/files/usr/local/bin/s6-svscanboot.buster @@ -0,0 +1,33 @@ +#!/usr/local/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 "#!/usr/local/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 "#!/usr/local/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} +