#!/bin/sh # # shutdwn Common script for system halt/reboot. # # Author: Miquel van Smoorenburg, # Changes: Grzegorz Stanislawski # Arkadiusz Mi¶kiewicz # # $Id$ # Set the path. PATH=/sbin:/bin:/usr/bin:/usr/sbin # move to root dir cd / . /etc/rc.d/init.d/functions # avoid keyboard interruption trap "echo" INT SEGV QUIT TERM set +e # Kill all processes. [ "${BASH+bash}" = bash ] && enable kill runlevel=$1 run_cmd "Sending all processes the TERM signal" killall5 -15 sleep 5 run_cmd "Sending all processes the KILL signal" killall5 -9 [ -x /etc/rc.d/rc.acct ] && /etc/rc.d/rc.acct stop halt -w show "The system is halted"; ok # This must be last line ! # vi:syntax=sh:tw=78:ts=8:sw=4