]> git.netwichtig.de Git - user/henk/code/puppet/modules/s6.git/blob - files/usr/local/bin/s6-svscanboot.buster
add ISO8601 timestamp
[user/henk/code/puppet/modules/s6.git] / files / usr / local / bin / s6-svscanboot.buster
1 #!/usr/local/bin/execlineb -S1
2
3 foreground { redirfd -w 2 /dev/null mkdir -p /run/uncaught-logs }
4 if { chown s6-logs:s6-logs /run/uncaught-logs }
5 if { chmod 2700 /run/uncaught-logs }
6 foreground { redirfd -w 2 /dev/null mkdir -p ${1}/.s6-svscan ${1}/s6-svscan-log }
7 foreground { redirfd -w 2 /dev/null ln -sf /bin/false ${1}/.s6-svscan/crash }
8 if
9 {
10   redirfd -w 1 ${1}/.s6-svscan/finish
11   heredoc 0 "#!/usr/local/bin/execlineb -P\ns6-svc -x -- \"${1}/s6-svscan-log\"\n"
12   cat
13 }
14 if { chmod 0755 ${1}/.s6-svscan/finish }
15 foreground { redirfd -w 2 /dev/null mkfifo -m 0600 ${1}/s6-svscan-log/fifo }
16 if
17 {
18   redirfd -w 1 ${1}/s6-svscan-log/run
19   heredoc 0 "#!/usr/local/bin/execlineb -P
20 redirfd -w 2 /dev/console
21 redirfd -rnb 0 fifo
22 s6-setuidgid s6-logs
23 exec -c
24 s6-log t T /run/uncaught-logs\n"
25   cat
26 }
27 if { chmod 0755 ${1}/s6-svscan-log/run }
28
29 redirfd -r 0 /dev/null
30 redirfd -wnb 1 ${1}/s6-svscan-log/fifo
31 fdmove -c 2 1
32 piperw 3 4
33 background {
34         fdclose 3
35         s6-setsid
36         s6-svscan -d4 -- ${1}
37 }
38 fdclose 4
39 fdmove 1 3
40 head -n 1