summaryrefslogtreecommitdiff
path: root/system/s6/s6-svscanboot
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-06-15 00:38:04 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-06-15 00:38:04 -0500
commita12b74b878220dc796e4e4cb44d277466212113e (patch)
tree316df4c4563fa18a4104cf6f38ea04ad3f80caad /system/s6/s6-svscanboot
parent0a4f8dbe950b88c078c79fbd57e6bc7f3cdd5962 (diff)
downloadpackages-a12b74b878220dc796e4e4cb44d277466212113e.tar.gz
packages-a12b74b878220dc796e4e4cb44d277466212113e.tar.bz2
packages-a12b74b878220dc796e4e4cb44d277466212113e.tar.xz
packages-a12b74b878220dc796e4e4cb44d277466212113e.zip
system/s6: new package
Diffstat (limited to 'system/s6/s6-svscanboot')
-rw-r--r--system/s6/s6-svscanboot32
1 files changed, 32 insertions, 0 deletions
diff --git a/system/s6/s6-svscanboot b/system/s6/s6-svscanboot
new file mode 100644
index 000000000..2b41d2916
--- /dev/null
+++ b/system/s6/s6-svscanboot
@@ -0,0 +1,32 @@
+#!/bin/execlineb -S1
+
+foreground { redirfd -w 2 /dev/null mkdir -p /run/uncaught-logs }
+if { chown catchlog:catchlog /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 catchlog
+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 -St0 ${1}