
#!/bin/sh
#
# killall	This file is executed by init when it goes into runlevel
#               0 (halt) or runlevel 6 (reboot). It kills all processes,
#               unmounts file systems and then either halts or reboots.
#
# Author:       Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
#               Modified for RHS Linux by Damien Neil

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

# See how we were called.
case "$0" in
  *halt)
	message="Halting the system."
	command="halt"
	;;
  *reboot)
	message="Please stand by while rebooting the system..."
	command="reboot"
	;;
  *)
	echo "$0: link me as \"kilall.halt\" or \"killall.reboot\" please!"
	exit 1
	;;
esac

echo "Sending all processes the TERM signal..."
killall5 

echo "Sending all processes the KILL signal.."
killall5 -9

hwclock --directisa -systohc

#umount stuff
umount -a -f -t noproc 

# I should really automate these:
	umount -f /proc
	umount -f /dev/pts
	umount -f /

#		mount -n -o ro /
		df -a
echo; echo "umounted all from fstab and /proc"; echo

#remount our / readonly..
#mount -n -o ro /

#add anything else while root has 
#been cleanly umounted and mounted ro
#before actual shutdown/reboot 


# Now halt or reboot.
echo "$message"
eval $command -d -i

