view core/sysvinit/rc.shutdown @ 218:d282507aa08d

templates: add meson.sh
author David Demelier <markand@malikania.fr>
date Wed, 20 Mar 2019 20:12:00 +0100
parents 36f3ab3945d7
children 01b5d3175215
line wrap: on
line source

#
# /etc/rc.shutdown: reboot and halt script
#

if [ -f /etc/rc.conf ]; then
	source /etc/rc.conf
fi

echo "Terminating all processes."
/usr/sbin/killall5 -15

echo "Unmounting all filesystems."
/usr/sbin/halt -w
/usr/sbin/swapoff -a

if [ -x /usr/bin/mount ]; then
	/usr/bin/umount -a -d -r -t nosysfs,noproc,nodevtmpfs
	/usr/bin/umount -a -r
	/usr/bin/mount -o remount,ro /
fi

if [ "$1" = "0" ]; then
	/usr/sbin/poweroff -d -f -i
else
	/usr/sbin/reboot -d -f -i
fi