summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--package/deps.mak18
-rw-r--r--package/modes10
-rw-r--r--package/targets.mak18
-rwxr-xr-xsrc/lib/service/system/.s6-svscan/SIGINT5
-rwxr-xr-xsrc/lib/service/system/.s6-svscan/SIGPWR5
-rwxr-xr-xsrc/lib/service/system/.s6-svscan/SIGQUIT2
-rwxr-xr-xsrc/lib/service/system/.s6-svscan/SIGTERM2
-rwxr-xr-xsrc/lib/service/system/.s6-svscan/SIGUSR15
-rwxr-xr-xsrc/lib/service/system/.s6-svscan/SIGUSR25
-rwxr-xr-xsrc/lib/service/system/.s6-svscan/SIGWINCH2
-rwxr-xr-xsrc/lib/service/system/.s6-svscan/crash10
-rwxr-xr-xsrc/lib/service/system/.s6-svscan/finish9
12 files changed, 91 insertions, 0 deletions
diff --git a/package/deps.mak b/package/deps.mak
index 0608555..586b8a9 100644
--- a/package/deps.mak
+++ b/package/deps.mak
@@ -6,6 +6,24 @@ system-init: src/bin/system-init
$(DESTDIR)$(bindir)/system-init: system-init
system-shutdown: src/bin/system-shutdown
$(DESTDIR)$(bindir)/system-shutdown: system-shutdown
+service/system/.s6-svscan/crash: src/lib/service/system/.s6-svscan/crash
+$(DESTDIR)$(libdir)/service/system/.s6-svscan/crash: service/system/.s6-svscan/crash
+service/system/.s6-svscan/SIGUSR1: src/lib/service/system/.s6-svscan/SIGUSR1
+$(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGUSR1: service/system/.s6-svscan/SIGUSR1
+service/system/.s6-svscan/finish: src/lib/service/system/.s6-svscan/finish
+$(DESTDIR)$(libdir)/service/system/.s6-svscan/finish: service/system/.s6-svscan/finish
+service/system/.s6-svscan/SIGQUIT: src/lib/service/system/.s6-svscan/SIGQUIT
+$(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGQUIT: service/system/.s6-svscan/SIGQUIT
+service/system/.s6-svscan/SIGINT: src/lib/service/system/.s6-svscan/SIGINT
+$(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGINT: service/system/.s6-svscan/SIGINT
+service/system/.s6-svscan/SIGUSR2: src/lib/service/system/.s6-svscan/SIGUSR2
+$(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGUSR2: service/system/.s6-svscan/SIGUSR2
+service/system/.s6-svscan/SIGWINCH: src/lib/service/system/.s6-svscan/SIGWINCH
+$(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGWINCH: service/system/.s6-svscan/SIGWINCH
+service/system/.s6-svscan/SIGTERM: src/lib/service/system/.s6-svscan/SIGTERM
+$(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGTERM: service/system/.s6-svscan/SIGTERM
+service/system/.s6-svscan/SIGPWR: src/lib/service/system/.s6-svscan/SIGPWR
+$(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGPWR: service/system/.s6-svscan/SIGPWR
service/system/goetia-shutdown/run: src/lib/service/system/goetia-shutdown/run
$(DESTDIR)$(libdir)/service/system/goetia-shutdown/run: service/system/goetia-shutdown/run
service/system/goetia-shutdown/stage3b: src/lib/service/system/goetia-shutdown/stage3b
diff --git a/package/modes b/package/modes
index 1a7a245..b3bf879 100644
--- a/package/modes
+++ b/package/modes
@@ -2,5 +2,15 @@ goetia-pam-wrapper 0755
system-init 0755
system-shutdown 0755
+service/system/.s6-svscan/crash 0755
+service/system/.s6-svscan/finish 0755
+service/system/.s6-svscan/SIGINT 0755
+service/system/.s6-svscan/SIGPWR 0755
+service/system/.s6-svscan/SIGQUIT 0755
+service/system/.s6-svscan/SIGTERM 0755
+service/system/.s6-svscan/SIGUSR1 0755
+service/system/.s6-svscan/SIGUSR2 0755
+service/system/.s6-svscan/SIGWINCH 0755
+
service/system/getty-12-srv/run 0755
service/system/goetia-shutdown/run 0755
diff --git a/package/targets.mak b/package/targets.mak
index 17eb540..508898e 100644
--- a/package/targets.mak
+++ b/package/targets.mak
@@ -15,12 +15,30 @@ SLASHCOMMAND_BINS ::= \
$(DESTDIR)$(sproot)/command/system-shutdown \
ALL_LIBS ::= \
+ service/system/.s6-svscan/crash \
+ service/system/.s6-svscan/SIGUSR1 \
+ service/system/.s6-svscan/finish \
+ service/system/.s6-svscan/SIGQUIT \
+ service/system/.s6-svscan/SIGINT \
+ service/system/.s6-svscan/SIGUSR2 \
+ service/system/.s6-svscan/SIGWINCH \
+ service/system/.s6-svscan/SIGTERM \
+ service/system/.s6-svscan/SIGPWR \
service/system/goetia-shutdown/run \
service/system/goetia-shutdown/stage3b \
service/system/goetia-shutdown/down \
service/system/goetia-shutdown/stage4 \
INSTALL_LIBS ::= \
+ $(DESTDIR)$(libdir)/service/system/.s6-svscan/crash \
+ $(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGUSR1 \
+ $(DESTDIR)$(libdir)/service/system/.s6-svscan/finish \
+ $(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGQUIT \
+ $(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGINT \
+ $(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGUSR2 \
+ $(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGWINCH \
+ $(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGTERM \
+ $(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGPWR \
$(DESTDIR)$(libdir)/service/system/goetia-shutdown/run \
$(DESTDIR)$(libdir)/service/system/goetia-shutdown/stage3b \
$(DESTDIR)$(libdir)/service/system/goetia-shutdown/down \
diff --git a/src/lib/service/system/.s6-svscan/SIGINT b/src/lib/service/system/.s6-svscan/SIGINT
new file mode 100755
index 0000000..7b00dd5
--- /dev/null
+++ b/src/lib/service/system/.s6-svscan/SIGINT
@@ -0,0 +1,5 @@
+#!@shebangdir@/execlineb -P
+
+# ISC license.
+
+system-shutdown -r
diff --git a/src/lib/service/system/.s6-svscan/SIGPWR b/src/lib/service/system/.s6-svscan/SIGPWR
new file mode 100755
index 0000000..b7e4956
--- /dev/null
+++ b/src/lib/service/system/.s6-svscan/SIGPWR
@@ -0,0 +1,5 @@
+#!@shebangdir@/execlineb -P
+
+# ISC license.
+
+system-shutdown -p
diff --git a/src/lib/service/system/.s6-svscan/SIGQUIT b/src/lib/service/system/.s6-svscan/SIGQUIT
new file mode 100755
index 0000000..4d6fd2f
--- /dev/null
+++ b/src/lib/service/system/.s6-svscan/SIGQUIT
@@ -0,0 +1,2 @@
+#!@shebangdir@/execlineb -P
+
diff --git a/src/lib/service/system/.s6-svscan/SIGTERM b/src/lib/service/system/.s6-svscan/SIGTERM
new file mode 100755
index 0000000..4d6fd2f
--- /dev/null
+++ b/src/lib/service/system/.s6-svscan/SIGTERM
@@ -0,0 +1,2 @@
+#!@shebangdir@/execlineb -P
+
diff --git a/src/lib/service/system/.s6-svscan/SIGUSR1 b/src/lib/service/system/.s6-svscan/SIGUSR1
new file mode 100755
index 0000000..b7e4956
--- /dev/null
+++ b/src/lib/service/system/.s6-svscan/SIGUSR1
@@ -0,0 +1,5 @@
+#!@shebangdir@/execlineb -P
+
+# ISC license.
+
+system-shutdown -p
diff --git a/src/lib/service/system/.s6-svscan/SIGUSR2 b/src/lib/service/system/.s6-svscan/SIGUSR2
new file mode 100755
index 0000000..cf21071
--- /dev/null
+++ b/src/lib/service/system/.s6-svscan/SIGUSR2
@@ -0,0 +1,5 @@
+#!@shebangdir@/execlineb -P
+
+# ISC license.
+
+system-shutdown -h
diff --git a/src/lib/service/system/.s6-svscan/SIGWINCH b/src/lib/service/system/.s6-svscan/SIGWINCH
new file mode 100755
index 0000000..4d6fd2f
--- /dev/null
+++ b/src/lib/service/system/.s6-svscan/SIGWINCH
@@ -0,0 +1,2 @@
+#!@shebangdir@/execlineb -P
+
diff --git a/src/lib/service/system/.s6-svscan/crash b/src/lib/service/system/.s6-svscan/crash
new file mode 100755
index 0000000..25d71ae
--- /dev/null
+++ b/src/lib/service/system/.s6-svscan/crash
@@ -0,0 +1,10 @@
+#!@shebangdir@/execlineb -P
+
+# ISC license.
+
+redirfd -w 2 /dev/console
+fdmove -c 1 2
+
+foreground { echo "s6-svscan crashed. Rebooting." }
+
+shutdown -o -r now
diff --git a/src/lib/service/system/.s6-svscan/finish b/src/lib/service/system/.s6-svscan/finish
new file mode 100755
index 0000000..38c3c9c
--- /dev/null
+++ b/src/lib/service/system/.s6-svscan/finish
@@ -0,0 +1,9 @@
+#!@shebangdir@/execlineb -P
+
+
+redirfd -w 2 /dev/console
+fdmove -c 1 2
+
+foreground { echo "s6-svscan exited. Rebooting." }
+
+shutdown -o -r now