From 980c5408489a3a3a56e49c3873f1bce6a0155cad Mon Sep 17 00:00:00 2001 From: PS
Date: Sun, 1 Feb 2026 12:02:03 +0100 Subject: version 0.2.0.0 --- src/bin/system-shutdown-daemon | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 src/bin/system-shutdown-daemon (limited to 'src/bin/system-shutdown-daemon') diff --git a/src/bin/system-shutdown-daemon b/src/bin/system-shutdown-daemon new file mode 100755 index 0000000..6419bfb --- /dev/null +++ b/src/bin/system-shutdown-daemon @@ -0,0 +1,31 @@ +#!@shebangdir@/execlineb -P + +# ISC license. + +tryexec { ./stage3b } + +if -n { + foreground { echo "\nsystem-shutdown!\n" } + foreground { s6-rc -l @tmpfsdir@/@sysrundir@/s6-rc -v2 -b -Da -t@timeout@ change } + foreground { + pipeline { ls -1 @tmpfsdir@/@sysrundir@/service/ } + pipeline { + sed + -e /s6-svscan-log/d + -e /.s6-svscan/d + -e /goetia-shutdown/d + -e /goetia-rescue/d + } + forstdin -pE SERVICE + s6-svc -T @timeout@ -D @tmpfsdir@/@sysrundir@/service/${SERVICE} + } + + foreground { rm -Rf -- @syslogdir@/uncaught-logs } + foreground { cp -Rpf -- @tmpfsdir@/@sysrundir@/log/uncaught-logs @syslogdir@/ } + + foreground { chmod u+x ./stage3b } + foreground { echo "sending all processes the TERM signal..." } + foreground { kill -SIGTERM -- -1 } +} +foreground { touch ./down } +chmod a-x ./stage3b -- cgit v1.2.3