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

/etc/init.d/rcS: tazpkg does not support /var/run symlink
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Nov 26 15:37:00 2013 +0000 (2013-11-26)
parents bf2f87edd87c
children 93758e8de78a
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/lib/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