summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorPS <p@0x53.net>2026-02-07 10:16:45 +0100
committerPS <p@0x53.net>2026-02-07 10:16:45 +0100
commitf7df2f7bb6abbea365cccb1345dcf1a1b7a80797 (patch)
tree2bead70379ffd134fb4190c9564b37c5c68cf581 /src/lib
parent980c5408489a3a3a56e49c3873f1bce6a0155cad (diff)
downloadgoetia-base-f7df2f7bb6abbea365cccb1345dcf1a1b7a80797.tar.gz
goetia-base-f7df2f7bb6abbea365cccb1345dcf1a1b7a80797.tar.bz2
goetia-base-f7df2f7bb6abbea365cccb1345dcf1a1b7a80797.zip
Improve usertree shutdown; improve system .s6-svscan directory
Diffstat (limited to 'src/lib')
-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
-rw-r--r--src/lib/service/user/.s6-svscan/finish8
-rw-r--r--src/lib/service/user/goetia-shutdown/down0
-rwxr-xr-xsrc/lib/service/user/goetia-shutdown/run20
12 files changed, 28 insertions, 45 deletions
diff --git a/src/lib/service/system/.s6-svscan/SIGINT b/src/lib/service/system/.s6-svscan/SIGINT
deleted file mode 100755
index 7b00dd5..0000000
--- a/src/lib/service/system/.s6-svscan/SIGINT
+++ /dev/null
@@ -1,5 +0,0 @@
-#!@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
deleted file mode 100755
index b7e4956..0000000
--- a/src/lib/service/system/.s6-svscan/SIGPWR
+++ /dev/null
@@ -1,5 +0,0 @@
-#!@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
deleted file mode 100755
index 4d6fd2f..0000000
--- a/src/lib/service/system/.s6-svscan/SIGQUIT
+++ /dev/null
@@ -1,2 +0,0 @@
-#!@shebangdir@/execlineb -P
-
diff --git a/src/lib/service/system/.s6-svscan/SIGTERM b/src/lib/service/system/.s6-svscan/SIGTERM
deleted file mode 100755
index 4d6fd2f..0000000
--- a/src/lib/service/system/.s6-svscan/SIGTERM
+++ /dev/null
@@ -1,2 +0,0 @@
-#!@shebangdir@/execlineb -P
-
diff --git a/src/lib/service/system/.s6-svscan/SIGUSR1 b/src/lib/service/system/.s6-svscan/SIGUSR1
deleted file mode 100755
index b7e4956..0000000
--- a/src/lib/service/system/.s6-svscan/SIGUSR1
+++ /dev/null
@@ -1,5 +0,0 @@
-#!@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
deleted file mode 100755
index cf21071..0000000
--- a/src/lib/service/system/.s6-svscan/SIGUSR2
+++ /dev/null
@@ -1,5 +0,0 @@
-#!@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
deleted file mode 100755
index 4d6fd2f..0000000
--- a/src/lib/service/system/.s6-svscan/SIGWINCH
+++ /dev/null
@@ -1,2 +0,0 @@
-#!@shebangdir@/execlineb -P
-
diff --git a/src/lib/service/system/.s6-svscan/crash b/src/lib/service/system/.s6-svscan/crash
deleted file mode 100755
index 9fa8bd4..0000000
--- a/src/lib/service/system/.s6-svscan/crash
+++ /dev/null
@@ -1,10 +0,0 @@
-#!@shebangdir@/execlineb -P
-
-# ISC license.
-
-redirfd -w 2 /dev/console
-fdmove -c 1 2
-
-foreground { echo "s6-svscan crashed. Rebooting." }
-
-linux-powertool -r
diff --git a/src/lib/service/system/.s6-svscan/finish b/src/lib/service/system/.s6-svscan/finish
deleted file mode 100755
index fa3654c..0000000
--- a/src/lib/service/system/.s6-svscan/finish
+++ /dev/null
@@ -1,9 +0,0 @@
-#!@shebangdir@/execlineb -P
-
-
-redirfd -w 2 /dev/console
-fdmove -c 1 2
-
-foreground { echo "s6-svscan exited. Rebooting." }
-
-linux-powertool -r
diff --git a/src/lib/service/user/.s6-svscan/finish b/src/lib/service/user/.s6-svscan/finish
new file mode 100644
index 0000000..caf0dbc
--- /dev/null
+++ b/src/lib/service/user/.s6-svscan/finish
@@ -0,0 +1,8 @@
+#!@shebangdir@/execlineb -P
+
+multisubstitute {
+ importas -Si USER
+ importas -Si USERTREE
+}
+
+rm -Rf @tmpfsdir@/@usrrundir@/${USER}/${USERTREE}
diff --git a/src/lib/service/user/goetia-shutdown/down b/src/lib/service/user/goetia-shutdown/down
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/lib/service/user/goetia-shutdown/down
diff --git a/src/lib/service/user/goetia-shutdown/run b/src/lib/service/user/goetia-shutdown/run
new file mode 100755
index 0000000..e13d016
--- /dev/null
+++ b/src/lib/service/user/goetia-shutdown/run
@@ -0,0 +1,20 @@
+#!@shebangdir@/execlineb -P
+
+# ISC license.
+
+fdmove -c 2 1
+
+multisubstitute {
+ importas -Si USER
+ importas -Si USERTREE
+}
+
+if -x0 { eltest -d @tmpfsdir@/@usrrundir@/${USER}/${USERTREE} }
+
+foreground {
+ foreground { echo "\nshutdown\n" }
+ s6-rc -l @tmpfsdir@/@usrrundir@/${USER}/${USERTREE}/s6-rc -v2 -b -da -t@timeout@ change
+}
+
+foreground { s6-svc -h @tmpfsdir@/@usrrundir@/${USER}/${USERTREE}/service/s6-svscan-log }
+foreground { s6-svscanctl -t @tmpfsdir@/@usrrundir@/${USER}/${USERTREE}/service }