aboutsummaryrefslogtreecommitdiff
path: root/repos/core/initscripts/rc.shutdown
blob: 68b47022187b6cc98520cd03000c423e30f3b94f (plain)
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
#!/bin/sh

echo "shutting down"

if [ -x /etc/rc.shutdown.local ]; then
	/etc/rc.shutdown.local
fi

if [ "$(command -v udevadm)" ]; then
	udevadm control --exit
fi

sv down /var/service/*
dd if=/dev/urandom of=/var/lib/random-seed count=1 bs=512 2>/dev/null
hwclock -w -u
kill -s TERM -1
sleep 2
kill -s KILL -1
swapoff -a
ip link set lo down
umount -a -r -t noproc
mount -o remount,ro /
sync
sleep 1
wait

echo bye