8
# Short-Description: Execute the halt command.
14
PATH=/sbin:/usr/sbin:/bin:/usr/bin
15
[ -f /etc/default/halt ] && . /etc/default/halt
17
. /lib/lsb/init-functions
20
if [ "$INIT_HALT" = "" ]
35
# See if we need to cut the power.
36
if [ "$INIT_HALT" = "POWEROFF" ] && [ -x /etc/init.d/ups-monitor ]
38
/etc/init.d/ups-monitor poweroff
41
# Don't shut down drives if we're using RAID.
43
if grep -qs '^md.*active' /proc/mdstat
48
# If INIT_HALT=HALT don't poweroff.
50
if [ "$INIT_HALT" = "HALT" ]
55
# Make it possible to not shut down network interfaces,
56
# needed to use wake-on-lan
58
if [ "$NETDOWN" = "no" ]; then
62
log_action_msg "Will now halt"
63
halt -d -f $netdown $poweroff $hddown
70
restart|reload|force-reload)
71
echo "Error: argument '$1' not supported" >&2
78
echo "Usage: $0 start|stop" >&2