?? rc
字號:
#! /bin/bash## rc This file is responsible for starting/stopping# services when the runlevel changes.## Original Author: # Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>## check a file to be a correct runlevel scriptcheck_runlevel (){ # Check if the file exists at all. [ -x "$1" ] || return 1 # Reject backup files and files generated by rpm. case "$1" in *.rpmsave|*.rpmorig|*.rpmnew|*~|*.orig) return 1 ;; esac return 0}# Now find out what the current and what the previous runlevel are.argv1="$1"set `/sbin/runlevel`runlevel=$2previous=$1export runlevel previous. /etc/init.d/functions# See if we want to be in user confirmation modeif [ "$previous" = "N" ]; then if [ -f /var/run/confirm ] \ || grep -i confirm /proc/cmdline >/dev/null ; then rm -f /var/run/confirm CONFIRM=yes export CONFIRM echo $"Entering interactive startup" else echo $"Entering non-interactive startup" fifi# Get first argument. Set new runlevel to this argument.[ -n "$argv1" ] && runlevel="$argv1"# Is there an rc directory for this new runlevel?[ -d /etc/rc$runlevel.d ] || exit 0# First, run the KILL scripts.#@@ New codemake -j -f /etc/rc.d/runlevel.mk RUNLEVEL=$runlevel JOB=stop#::for i in /etc/rc$runlevel.d/K* ; do#:: check_runlevel "$i" || continue#::#:: # Check if the subsystem is already up.#:: subsys=${i#/etc/rc$runlevel.d/K??}#:: [ -f /var/lock/subsys/$subsys -o -f /var/lock/subsys/$subsys.init ] \#:: || continue#::#:: # Bring the subsystem down.#:: if egrep -q "(killproc |action )" $i ; then#:: $i stop#:: else#:: action $"Stopping $subsys: " $i stop#:: fi#::done# Now run the START scripts.#@@ New codemake -j -f /etc/rc.d/runlevel.mk RUNLEVEL=$runlevel JOB=start#::for i in /etc/rc$runlevel.d/S* ; do#:: check_runlevel "$i" || continue#::#:: # Check if the subsystem is already up.#:: subsys=${i#/etc/rc$runlevel.d/S??}#:: [ -f /var/lock/subsys/$subsys -o -f /var/lock/subsys/$subsys.init ] \#:: && continue#:: #:: # If we're in confirmation mode, get user confirmation#:: if [ -n "$CONFIRM" ]; then#:: confirm $subsys#:: case $? in#:: 0) :;;#:: 2) CONFIRM=;;#:: *) continue;;#:: esac #:: fi#::#:: # Bring the subsystem up.#:: if [ "$subsys" = "halt" -o "$subsys" = "reboot" ]; then#:: export LC_ALL=C#:: exec $i start#:: fi#:: if egrep -q "(daemon |action |success |failure )" $i 2>/dev/null \#:: || [ "$subsys" = "single" -o "$subsys" = "local" ]; then#:: $i start#:: else#:: action $"Starting $subsys: " $i start#:: fi#::done
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -