comparison core/sysvinit/rc.shutdown @ 184:36f3ab3945d7

core/sysvinit: add basic init scripts
author David Demelier <markand@malikania.fr>
date Sat, 16 Mar 2019 21:54:36 +0100
parents
children 01b5d3175215
comparison
equal deleted inserted replaced
183:2a742bf097aa 184:36f3ab3945d7
1 #
2 # /etc/rc.shutdown: reboot and halt script
3 #
4
5 if [ -f /etc/rc.conf ]; then
6 source /etc/rc.conf
7 fi
8
9 echo "Terminating all processes."
10 /usr/sbin/killall5 -15
11
12 echo "Unmounting all filesystems."
13 /usr/sbin/halt -w
14 /usr/sbin/swapoff -a
15
16 if [ -x /usr/bin/mount ]; then
17 /usr/bin/umount -a -d -r -t nosysfs,noproc,nodevtmpfs
18 /usr/bin/umount -a -r
19 /usr/bin/mount -o remount,ro /
20 fi
21
22 if [ "$1" = "0" ]; then
23 /usr/sbin/poweroff -d -f -i
24 else
25 /usr/sbin/reboot -d -f -i
26 fi