#!/bin/bash # # rc.halt 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, # Modified for RHS Linux by Damien Neil # # Hacked by jwz to do almost nothing. # On my kiosk machines, it is safe to simply power the machine off at # any time -- no state can be lost. Therefore, it is also safe to shut # down without a lot of killing of processes... # Set the path. PATH=/sbin:/bin:/usr/bin:/usr/sbin . /etc/rc.d/init.d/functions runcmd() { echo -n "$1 " shift if [ "$BOOTUP" = "color" ]; then $* && echo_success || echo_failure else $* fi echo } # See how we were called. case "$0" in *halt) message="The system is halted" command="halt" ;; *reboot) message="Please stand by while rebooting the system..." command="reboot" ;; *) echo "$0: call me as \"rc.halt\" or \"rc.reboot\" please!" exit 1 ;; esac # Kill all processes. [ "${BASH+bash}" = bash ] && enable kill runcmd "Sending all processes the TERM signal..." /sbin/killall5 -15 sleep 5 runcmd "Sending all processes the KILL signal.." /sbin/killall5 -9 mount -n -o remount,ro / # jwz: this one too mount -n -o remount,ro /boot # jwz: don't do any of the rest of the stuff that was here... # Now halt or reboot. echo "$message" if [ -f /fastboot ]; then echo "On the next boot fsck will be skipped." elif [ -f /forcefsck ]; then echo "On the next boot fsck will be forced." fi eval $command -i -d -p