# HG changeset patch # User Christophe Lincoln # Date 1196422542 -3600 # Node ID a052c0a3dd7f83d15d7cdb0b1c2bc547679e1462 # Parent e860c8bd2c5711d922d85759d82430bd49d5f1d6 Add the shutdown script and one for local command diff -r e860c8bd2c57 -r a052c0a3dd7f etc/init.d/local.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/etc/init.d/local.sh Fri Nov 30 12:35:42 2007 +0100 @@ -0,0 +1,8 @@ +#!/bin/sh +# /etc/init.d/local.sh - Local startup commands. +# All commands here will be executed at boot time. +# +. /etc/init.d/rc.functions + +echo "Starting local startup commands... " + diff -r e860c8bd2c57 -r a052c0a3dd7f etc/init.d/rc.shutdown --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/etc/init.d/rc.shutdown Fri Nov 30 12:35:42 2007 +0100 @@ -0,0 +1,38 @@ +#!/bin/sh +# /etc/init.d/rc.shutdown - This script is used by /etc/inittab to stop +# all demons and shutdown the system. +# +. /etc/init.d/rc.functions +. /etc/rcS.conf + +echo "" +echo "========" +echo "" +echo -e "\033[1m System is going down for reboot or halt.\033[0m" +echo "" +echo "========" +echo "" + +# Stop all daemons started at boot time. +echo "Stoping all demons started at boot time..." +for daemon in $RUN_DAEMONS +do + if [ -x /etc/init.d/$daemon ]; then + /etc/init.d/$daemon stop + fi +done + +# Sync all filesystems. +echo -n "Syncing all filesystems... " +sync +status && sleep 2 + +# Swap off. +echo -n "Disabling swap space... " +/sbin/swapoff -a +status && sleep 2 + +# Umount filesystems. +echo -n "Unmounting all filesystems... " +/bin/umount -a -r +#status