about summary refs log tree commit diff
path: root/3
diff options
context:
space:
mode:
authorBas Ploeger <5904333+basploeger@users.noreply.github.com>2022-04-09 23:52:37 +0200
committerToyam Cox <aviator45003@gmail.com>2023-01-09 13:24:59 -0500
commit69876b5981557910d05b119c91a492f93016ddf5 (patch)
tree0a2af0773f2296828be0ffba85d8f46bd54447ed /3
parentfa197f0d9e18070b6b28cfdd38f22fbc8cf2f69d (diff)
downloadrunit-void-69876b5981557910d05b119c91a492f93016ddf5.tar.gz
runit-void-69876b5981557910d05b119c91a492f93016ddf5.tar.xz
runit-void-69876b5981557910d05b119c91a492f93016ddf5.zip
Split run-level 3 script into separate files.
Diffstat (limited to '3')
-rwxr-xr-x351
1 files changed, 3 insertions, 48 deletions
diff --git a/3 b/3
index 469d437..0bd452a 100755
--- a/3
+++ b/3
@@ -6,52 +6,7 @@ PATH=/usr/bin:/usr/sbin
 . /etc/runit/functions
 detect_virt
 [ -r /etc/rc.conf ] && . /etc/rc.conf
-
 echo
-msg "Waiting for services to stop..."
-sv force-stop /var/service/*
-sv exit /var/service/*
-
-[ -x /etc/rc.shutdown ] && /etc/rc.shutdown
-
-if [ -z "$VIRTUALIZATION" ]; then
-    msg "Saving random number generator seed..."
-    seedrng
-fi
-
-if [ -z "$VIRTUALIZATION" -a -n "$HARDWARECLOCK" ]; then
-    hwclock --systohc ${HARDWARECLOCK:+--$(echo $HARDWARECLOCK |tr A-Z a-z)}
-fi
-
-halt -w  # for wtmp
-
-if [ -z "$VIRTUALIZATION" ]; then
-    msg "Stopping udev..."
-    udevadm control --exit
-fi
-
-msg "Sending TERM signal to processes..."
-pkill --inverse -s0,1 -TERM
-sleep 1
-msg "Sending KILL signal to processes..."
-pkill --inverse -s0,1 -KILL
-
-if [ -z "$VIRTUALIZATION" ]; then
-    msg "Unmounting filesystems, disabling swap..."
-    swapoff -a
-    umount -r -a -t nosysfs,noproc,nodevtmpfs,notmpfs
-    msg "Remounting rootfs read-only..."
-    mount -o remount,ro /
-fi
-
-sync
-
-if [ -z "$VIRTUALIZATION" ]; then
-    deactivate_vgs
-    deactivate_crypt
-    if [ -e /run/runit/reboot ] && command -v kexec >/dev/null; then
-        msg "Triggering kexec..."
-        kexec -e 2>/dev/null
-        # not reached when kexec was successful.
-    fi
-fi
+for f in /etc/runit/shutdown.d/*.sh; do
+	[ -r $f ] && . $f
+done