#! /bin/sh
# /etc/init.d/reboot: executed by init(8) upon entering runlevel 6 (reboot).
# $Id: reboot,v 1.4 1995/06/22 18:46:26 imurdock Exp $
#
# Adapted from a script by Miquel van Smoorenburg.

PATH="/sbin:/bin:/usr/sbin:/usr/bin"

# Kill all processes.
echo -n "Sending all processes the TERM signal... "
killall5 -15
echo "done."
sleep 5
echo -n "Sending all processes the KILL signal... "
killall5 -9
echo "done."

# Write a reboot record to /var/log/wtmp.
halt -w

echo -n "Deactivating swap... "
swapoff -a
echo "done."

echo -n "Unmounting file systems... "
umount -a 2>/dev/null
# If root is mounted read-only the above will have failed.
umount -a -n
echo "done."

mount -n -o remount,ro /

echo -n "Rebooting... "
eval reboot -d -f
