summaryrefslogtreecommitdiffstats
path: root/aaabasicfs/rc
diff options
context:
space:
mode:
authortnut <tnut at nutyx dot com>2012-01-08 12:12:28 +0100
committertnut <tnut at nutyx dot com>2012-01-08 12:12:28 +0100
commit9291e062cb24bac5d7c7059d4dc64669c1917b33 (patch)
treeae6f7e4fb2769d6c53b214c5e0b4d862f1df98dc /aaabasicfs/rc
parentc9972ec7f32bf9d37388e853fe9bf633e242d05a (diff)
downloadnutyx-pakxe-9291e062cb24bac5d7c7059d4dc64669c1917b33.tar.gz
nutyx-pakxe-9291e062cb24bac5d7c7059d4dc64669c1917b33.tar.bz2
nutyx-pakxe-9291e062cb24bac5d7c7059d4dc64669c1917b33.tar.xz
nutyx-pakxe-9291e062cb24bac5d7c7059d4dc64669c1917b33.zip
aaabasicfs 2011-3 et split des dépot base et extra en 2 git séparé
Diffstat (limited to 'aaabasicfs/rc')
-rwxr-xr-xaaabasicfs/rc112
1 files changed, 112 insertions, 0 deletions
diff --git a/aaabasicfs/rc b/aaabasicfs/rc
new file mode 100755
index 000000000..81736e9f5
--- /dev/null
+++ b/aaabasicfs/rc
@@ -0,0 +1,112 @@
+#!/bin/sh
+########################################################################
+# Begin $rc_base/init.d/rc
+#
+# Description : Main Run Level Control Script
+#
+# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
+#
+# Version : 00.00
+#
+# Notes :
+#
+########################################################################
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+stty sane
+
+trap "" INT QUIT TSTP
+
+[ "${1}" != "" ] && runlevel=${1}
+
+splashy_update_progress(){
+ STEPS_DIR=/etc/splashy/steps_dir
+ [ -r "/etc/default/splashy" ] && . "/etc/default/splashy"
+ SPL_UPD=/sbin/splashy_update
+ SPL_PRG=$STEPS_DIR/${runlevel}-progress
+ # load some default variables
+ if ! ( pidof splashy > /dev/null ); then
+ /sbin/splashy boot 2>/dev/null
+ sleep 1
+ else
+ PER=`sed -n 's+'${1}' ++ p' $SPL_PRG`
+ $SPL_UPD "progress $PER"
+ fi
+}
+
+if [ "${runlevel}" = "" ]; then
+ echo "Usage: ${0} <runlevel>" >&2
+ exit 1
+fi
+
+previous=${PREVLEVEL}
+[ "${previous}" = "" ] && previous=N
+
+if [ ! -d ${rc_base}/rc${runlevel}.d ]; then
+ boot_mesg "${rc_base}/rc${runlevel}.d does not exist." ${WARNING}
+ boot_mesg_flush
+ exit 1
+fi
+# Attempt to stop all service started by previous runlevel,
+# and killed in this runlevel
+if [ "${previous}" != "N" ]; then
+ for i in $(ls -v ${rc_base}/rc${runlevel}.d/K* 2> /dev/null)
+ do
+ check_script_status
+
+ suffix=${i#$rc_base/rc$runlevel.d/K[0-9][0-9]}
+ prev_start=$rc_base/rc$previous.d/S[0-9][0-9]$suffix
+ sysinit_start=$rc_base/rcsysinit.d/S[0-9][0-9]$suffix
+
+ if [ "${runlevel}" != "0" ] && [ "${runlevel}" != "6" ]; then
+ if [ ! -f ${prev_start} ] && [ ! -f ${sysinit_start} ]; then
+ boot_mesg -n "WARNING:\n\n${i} can't be" ${WARNING}
+ boot_mesg -n " executed because it was not"
+ boot_mesg -n " not started in the previous"
+ boot_mesg -n " runlevel (${previous})."
+ boot_mesg "" ${NORMAL}
+ boot_mesg_flush
+ continue
+ fi
+ fi
+ ${i} stop
+ error_value=${?}
+
+ if [ "${error_value}" != "0" ]; then
+ print_error_msg
+ fi
+ done
+fi
+
+#Start all functions in this runlevel
+for i in $( ls -v ${rc_base}/rc${runlevel}.d/S* 2> /dev/null)
+do
+ if [ "${previous}" != "N" ]; then
+ suffix=${i#$rc_base/rc$runlevel.d/S[0-9][0-9]}
+ stop=$rc_base/rc$runlevel.d/K[0-9][0-9]$suffix
+ prev_start=$rc_base/rc$previous.d/S[0-9][0-9]$suffix
+
+ [ -f ${prev_start} ] && [ ! -f ${stop} ] && continue
+ fi
+
+ check_script_status
+
+ case ${runlevel} in
+ 0|6)
+ [ -f /sbin/splashy ] && splashy_update_progress ${i}
+ ${i} stop
+ ;;
+ *)
+ [ -f /sbin/splashy ] && splashy_update_progress ${i}
+ ${i} start
+ ;;
+ esac
+ error_value=${?}
+
+ if [ "${error_value}" != "0" ]; then
+ print_error_msg
+ fi
+done
+# End $rc_base/init.d/rc