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

rc.shutdown: backout previous commit
author Richard Dunbar <mojo@slitaz.org>
date Wed Jul 16 21:30:54 2014 +0000 (2014-07-16)
parents 3c9cfc3876d4
children 6c2d6362887d
line source
1 #!/bin/sh
2 #
3 # /etc/init.d/rc.shutdown : Executed on system shutdown or reboot
4 #
5 . /etc/init.d/rc.functions
6 . /etc/rcS.conf
8 log=/var/log/slitaz/shutdown.log
10 # Clear and quiet shutdown
11 clear && echo "System is going down for reboot or halt." > $log
12 uptime >> $log
14 # Store last alsa settings.
15 if [ -x /usr/sbin/alsactl ]; then
16 alsactl store 2>> $log
17 fi
19 # Stop all daemons started at boot time.
20 for daemon in $RUN_DAEMONS
21 do
22 if [ -x /etc/init.d/$daemon ]; then
23 /etc/init.d/$daemon stop >> $log
24 fi
25 done
27 # Sync all filesystems.
28 sync
30 # Swap off.
31 /sbin/swapoff -a
33 # Kill all processes.
34 killall5
36 # Umount filesystems
37 /bin/umount -a -r 2>/dev/null