slitaz-boot-scripts rev 9 1.0.0
Add the shutdown script and one for local command
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri Nov 30 12:35:42 2007 +0100 (2007-11-30) |
parents | e860c8bd2c57 |
children | 07d37a2f51f6 |
files | etc/init.d/local.sh etc/init.d/rc.shutdown |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/etc/init.d/local.sh Fri Nov 30 12:35:42 2007 +0100 1.3 @@ -0,0 +1,8 @@ 1.4 +#!/bin/sh 1.5 +# /etc/init.d/local.sh - Local startup commands. 1.6 +# All commands here will be executed at boot time. 1.7 +# 1.8 +. /etc/init.d/rc.functions 1.9 + 1.10 +echo "Starting local startup commands... " 1.11 +
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/etc/init.d/rc.shutdown Fri Nov 30 12:35:42 2007 +0100 2.3 @@ -0,0 +1,38 @@ 2.4 +#!/bin/sh 2.5 +# /etc/init.d/rc.shutdown - This script is used by /etc/inittab to stop 2.6 +# all demons and shutdown the system. 2.7 +# 2.8 +. /etc/init.d/rc.functions 2.9 +. /etc/rcS.conf 2.10 + 2.11 +echo "" 2.12 +echo "========" 2.13 +echo "" 2.14 +echo -e "\033[1m System is going down for reboot or halt.\033[0m" 2.15 +echo "" 2.16 +echo "========" 2.17 +echo "" 2.18 + 2.19 +# Stop all daemons started at boot time. 2.20 +echo "Stoping all demons started at boot time..." 2.21 +for daemon in $RUN_DAEMONS 2.22 +do 2.23 + if [ -x /etc/init.d/$daemon ]; then 2.24 + /etc/init.d/$daemon stop 2.25 + fi 2.26 +done 2.27 + 2.28 +# Sync all filesystems. 2.29 +echo -n "Syncing all filesystems... " 2.30 +sync 2.31 +status && sleep 2 2.32 + 2.33 +# Swap off. 2.34 +echo -n "Disabling swap space... " 2.35 +/sbin/swapoff -a 2.36 +status && sleep 2 2.37 + 2.38 +# Umount filesystems. 2.39 +echo -n "Unmounting all filesystems... " 2.40 +/bin/umount -a -r 2.41 +#status