aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/service/system/goetia-shutdown
diff options
context:
space:
mode:
authorPS <p@0x53.net>2026-02-01 12:04:04 +0100
committerPS <p@0x53.net>2026-02-01 12:04:04 +0100
commite613c3945d4d81cce398c73fe7714860eb113006 (patch)
tree7b000a29d45af0a9ccb5038f053d47ac270af275 /src/lib/service/system/goetia-shutdown
downloadgoetia-linux-init-e613c3945d4d81cce398c73fe7714860eb113006.tar.gz
goetia-linux-init-e613c3945d4d81cce398c73fe7714860eb113006.tar.bz2
goetia-linux-init-e613c3945d4d81cce398c73fe7714860eb113006.zip
version 0.2.0.0
Diffstat (limited to 'src/lib/service/system/goetia-shutdown')
-rw-r--r--src/lib/service/system/goetia-shutdown/down0
-rwxr-xr-xsrc/lib/service/system/goetia-shutdown/run7
-rw-r--r--src/lib/service/system/goetia-shutdown/stage3b14
-rw-r--r--src/lib/service/system/goetia-shutdown/stage414
4 files changed, 35 insertions, 0 deletions
diff --git a/src/lib/service/system/goetia-shutdown/down b/src/lib/service/system/goetia-shutdown/down
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/lib/service/system/goetia-shutdown/down
diff --git a/src/lib/service/system/goetia-shutdown/run b/src/lib/service/system/goetia-shutdown/run
new file mode 100755
index 0000000..32f37fe
--- /dev/null
+++ b/src/lib/service/system/goetia-shutdown/run
@@ -0,0 +1,7 @@
+#!@shebangdir@/execlineb -P
+
+# ISC license.
+
+fdmove -c 2 1
+
+system-shutdown-daemon
diff --git a/src/lib/service/system/goetia-shutdown/stage3b b/src/lib/service/system/goetia-shutdown/stage3b
new file mode 100644
index 0000000..3daf81f
--- /dev/null
+++ b/src/lib/service/system/goetia-shutdown/stage3b
@@ -0,0 +1,14 @@
+#!@shebangdir@/execlineb -P
+
+# ISC license.
+
+if -n {
+ tryexec { ./stage4 }
+ foreground { chmod u+x stage4 }
+
+ foreground { kill -SIGCONT -- -1 }
+ foreground { sleep 1 }
+ foreground { echo sending all processes the KILL signal... }
+ foreground { kill -SIGKILL -- -1 }
+}
+chmod a-x stage3b stage4
diff --git a/src/lib/service/system/goetia-shutdown/stage4 b/src/lib/service/system/goetia-shutdown/stage4
new file mode 100644
index 0000000..1d25d68
--- /dev/null
+++ b/src/lib/service/system/goetia-shutdown/stage4
@@ -0,0 +1,14 @@
+#!@shebangdir@/execlineb -P
+
+# ISC license.
+
+if -n {
+ s6-envdir -I @tmpfsdir@/@sysrundir@/shutdown-directive
+ importas -SD "-r" DIRECTIVE
+
+ foreground { umount -a }
+ foreground { mount -o remount,ro / }
+
+ powertool ${DIRECTIVE}
+}
+chmod a-x stage3b stage4