slitaz-base-files rev 108
Add /etc/init.d/rc.shutdown from boot scripts (functions are used by deamon but boot-scripts are not needed in a chroot
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sun Mar 18 00:56:03 2012 +0100 (2012-03-18) |
parents | eb82a783ff60 |
children | c2f69fa0c490 |
files | rootfs/etc/init.d/rc.shutdown |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/rootfs/etc/init.d/rc.shutdown Sun Mar 18 00:56:03 2012 +0100 1.3 @@ -0,0 +1,37 @@ 1.4 +#!/bin/sh 1.5 +# /etc/init.d/rc.shutdown - This script is used by /etc/inittab to stop 1.6 +# all daemons and shutdown the system. 1.7 +# 1.8 +. /etc/init.d/rc.functions 1.9 +. /etc/rcS.conf 1.10 + 1.11 +log=/var/lib/shutdown.log 1.12 + 1.13 +# Bold info message with uptime 1.14 +clear && echo "System is going down for reboot or halt." > $log 1.15 +uptime >> $log 1.16 + 1.17 +# Store last alsa settings. 1.18 +if [ -x /usr/sbin/alsactl ]; then 1.19 + alsactl store 1.20 +fi 1.21 + 1.22 +# Stop all daemons started at boot time. 1.23 +for daemon in $RUN_DAEMONS 1.24 +do 1.25 + if [ -x /etc/init.d/$daemon ]; then 1.26 + /etc/init.d/$daemon stop >> $log 1.27 + fi 1.28 +done 1.29 + 1.30 +# Sync all filesystems. 1.31 +sync 1.32 + 1.33 +# Swap off. 1.34 +/sbin/swapoff -a 1.35 + 1.36 +# Kill all processes. 1.37 +killall5 1.38 + 1.39 +# Umount filesystems. 1.40 +/bin/umount -a -r 2>/dev/null