-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy path3
More file actions
executable file
·48 lines (33 loc) · 1.09 KB
/
3
File metadata and controls
executable file
·48 lines (33 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
exec 2> >(sed 's/^/:: /')
set -v
. /etc/rc.conf
echo 'Waiting for services to stop...'
sv -w196 force-stop /var/service/*
sv exit /var/service/*
stty onlcr
echo Shutdown...
runlevel=$(readlink -f /etc/runit/runsvdir/current)
runlevel=${runlevel#/run/service.}
[[ $runlevel = /run/service ]] && ref="DAEMONS[@]" || ref="DAEMONS_${runlevel}[@]"
[ -x /etc/rc.local.shutdown ] && /etc/rc.local.shutdown
dd if=/dev/urandom of=/var/lib/random-seed count=1 bs=512 &>/dev/null
hwclock --systohc ${HARDWARECLOCK:+--$(echo $HARDWARECLOCK |tr A-Z a-z)}
halt -w # for utmp
[[ $USELVM = yes ]] && vgchange --monitor n
udevadm control --exit
pkill --inverse -s0,1 -TERM
sleep 5
pkill --inverse -s0,1 -KILL
umount /tmp
swapoff -a
umount -r -a -t nosysfs,noproc,nodevtmpfs,notmpfs
[[ $USELVM = yes ]] && vgchange --sysinit -a n
awk '/^#/ || /^$/ { next }
NF>2 { print "ignite unsupported crypttab: " $0 >"/dev/stderr"; next }
{ system("cryptsetup luksClose " $1) }' </etc/crypttab
[[ $USELVM = yes ]] && vgchange --sysinit -a n
mount -o remount,ro /
sleep 1
sync