#!/bin/sh
case "$1" in
halt|reboot|poweroff)
	;;
*)
	echo "Have to use $0 [reboot|halt|poweroff]"
	exit 1
	;;
esac

# Set the path.
PATH=/sbin:/bin:/usr/bin:/usr/sbin

# move to root dir
cd /

. /etc/rc.d/init.d/functions

run_cmd "Sending all processes the TERM signal" killall5 -15
run_cmd "Sending all processes the KILL signal" killall5 -9

[ -x /etc/rc.d/rc.acct ] && /etc/rc.d/rc.acct stop

show "The system is halted"; ok

exec /sbin/system_off "$1"
