# HG changeset patch # User Christophe Lincoln # Date 1332230760 -3600 # Node ID bf2f87edd87c83ac7c0f718c5c3a18d7a5fcfa2e # Parent b9cd5851a5f03e69c17fc8be24474cbbc17810b8 rc.functions --> rc.shutdown diff -r b9cd5851a5f0 -r bf2f87edd87c etc/init.d/rc.functions --- a/etc/init.d/rc.functions Sun Mar 18 00:57:34 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -#!/bin/sh -# /etc/init.d/rc.functions: SliTaz boot scripts functions. -# - -# Status functions. -status() { - echo -en "\\033[70G[ " - if [ $? = 0 ]; then - echo -en "\\033[1;32mOK" - else - echo -en "\\033[1;31mFailed" - fi - echo -e "\\033[0;39m ]" -} - -# Check daemon with pidfile: usage check_pidfile $PIDFILE $DAEMON -active_pidfile() -{ - if [ ! -e $1 ]; then - return 1 - elif grep -qs "Name:.$(basename $2)$" \ - /proc/$(sed 's/[^0-9]//g' < $1 | head -n 1)/status ; then - return 0 - else - rm -f $1 - return 2 - fi -} diff -r b9cd5851a5f0 -r bf2f87edd87c etc/init.d/rc.shutdown --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/etc/init.d/rc.shutdown Tue Mar 20 09:06:00 2012 +0100 @@ -0,0 +1,37 @@ +#!/bin/sh +# /etc/init.d/rc.shutdown - This script is used by /etc/inittab to stop +# all daemons and shutdown the system. +# +. /etc/init.d/rc.functions +. /etc/rcS.conf + +log=/var/lib/shutdown.log + +# Bold info message with uptime +clear && echo "System is going down for reboot or halt." > $log +uptime >> $log + +# Store last alsa settings. +if [ -x /usr/sbin/alsactl ]; then + alsactl store +fi + +# Stop all daemons started at boot time. +for daemon in $RUN_DAEMONS +do + if [ -x /etc/init.d/$daemon ]; then + /etc/init.d/$daemon stop >> $log + fi +done + +# Sync all filesystems. +sync + +# Swap off. +/sbin/swapoff -a + +# Kill all processes. +killall5 + +# Umount filesystems. +/bin/umount -a -r 2>/dev/null