aboutsummaryrefslogtreecommitdiff
path: root/lib/init/rc.shutdown
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2019-12-18 21:04:42 +0300
committerCem Keylan <cem@ckyln.com>2019-12-18 21:04:42 +0300
commit54d7bde90161b3e01a5e15260d08e79f39096fec (patch)
tree115c5be853dc5a3be418c75dc4d9d5f3095a874c /lib/init/rc.shutdown
parent758d2e63839218d68b1a78a9571a263f58640a2d (diff)
downloadinit-54d7bde90161b3e01a5e15260d08e79f39096fec.tar.gz
add makefile
Diffstat (limited to 'lib/init/rc.shutdown')
-rwxr-xr-xlib/init/rc.shutdown48
1 files changed, 0 insertions, 48 deletions
diff --git a/lib/init/rc.shutdown b/lib/init/rc.shutdown
deleted file mode 100755
index 9dba627..0000000
--- a/lib/init/rc.shutdown
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/sh
-
-log() { printf '\033[36;1m=>\033[m\033[1m %s\n' "$@" ;}
-
-main() {
- PATH=/sbin:/bin:/usr/sbin:/usr/bin
-
- log "Waiting for services to stop..."; {
- sv -w196 force-stop /var/service/*
- sv exit /var/service/*
- }
-
- log "Saving random seed..."; {
- dd count=1 bs=512 if=/dev/random of=/var/random.seed
- }
-
- halt -w
-
- log "Sending TERM signal to all processes..."; {
- killall5 -TERM
- sleep 1
- }
-
- log "Sending KILL signal to all processes..."; {
- killall5 -KILL
- }
-
- log "Unmounting filesystems and disabling swap..." \
- "Remounting rootfs as readonly"; {
- swapoff -a
- umount -rat nosysfs,noproc,nodevtmpfs,notmpfs
- mount -o remount,ro /
-
- sync
- }
-
- log "Deactivating dmcrypt devices (if any exist)."; {
- [ -x /bin/cryptsetup ] && [ -x /bin/dmsetup ] && {
- dmsetup ls --target crypt \
- --exec "dmsetup info -c --noheadings -o open,name" |
- while read -r drive; do
- [ "${drive%%:*}" = "0" ] && cryptsetup close "${drive##*:}"
- done
- }
- }
-}
-
-main