slitaz-boot-scripts view etc/init.d/rc.shutdown @ rev 37

Prepa for release, add Andrew to the authors list
author Christophe Lincoln <pankso@slitaz.org>
date Sun Feb 24 21:04:52 2008 +0100 (2008-02-24)
parents f34a92a12c88
children 87bb2aa0140a
line source
1 #!/bin/sh
2 # /etc/init.d/rc.shutdown - This script is used by /etc/inittab to stop
3 # all demons and shutdown the system.
4 #
5 . /etc/init.d/rc.functions
6 . /etc/rcS.conf
8 # Bold info message with uptime
9 echo ""
10 echo -e "
11 ================================================================================
13 \033[1mSystem is going down for reboot or halt.\033[0m
15 Uptime:`uptime`
17 ================================================================================"
18 echo ""
20 # Stop all daemons started at boot time.
21 echo "Stoping all demons started at boot time..."
22 for daemon in $RUN_DAEMONS
23 do
24 if [ -x /etc/init.d/$daemon ]; then
25 /etc/init.d/$daemon stop
26 fi
27 done
29 # Sync all filesystems.
30 echo -n "Syncing all filesystems... "
31 sync
32 status && sleep 2
34 # Swap off.
35 echo -n "Disabling swap space... "
36 /sbin/swapoff -a
37 status
39 # Kill all processes.
40 echo -n "Killing all processes..."
41 killall5 && sleep 2
42 status
44 # Umount filesystems.
45 echo -n "Remonting rootfs read only..."
46 mount -o remount,ro /
47 status
48 echo "Unmounting all filesystems... "
49 /bin/umount -a -r
51 echo ""
52 usleep_progress
53 echo ""