]> git.pld-linux.org Git - projects/rc-scripts.git/blobdiff - rc.d/rc
remove debug
[projects/rc-scripts.git] / rc.d / rc
diff --git a/rc.d/rc b/rc.d/rc
index cff8fc94c77046615049d3366b4f3665cf66395c..7d7297f6877b136a684b8d709cf01e3b6b8aa197 100755 (executable)
--- a/rc.d/rc
+++ b/rc.d/rc
@@ -9,7 +9,6 @@
 #
 # Original Author:
 #              Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
-# Changes:     Arkadiusz Mi¶kiewicz <misiek@pld-linux.org>
 #
 
 # avoid being interrupted by child or keyboard
@@ -23,10 +22,10 @@ argv2="$2"
 [ -z "$CONSOLE" ] && CONSOLE=/dev/console
 if [ -c $CONSOLE ]; then
        set -- $(stty size < $CONSOLE 2>/dev/null)
-         LINES=$1
+       LINES=$1
        COLUMNS=$2
 else
-         LINES=
+       LINES=
        COLUMNS=
 fi
 export LINES COLUMNS CONSOLE
@@ -46,26 +45,12 @@ if [ -f /etc/sysconfig/i18n ]; then
        [ -n "$LINGUAS" ] && export LINGUAS || unset LINGUAS
 fi
 
-# Read system config data.
-if [ -f /etc/sysconfig/system ]; then
-       . /etc/sysconfig/system
-else
-       RUN_SULOGIN_ON_ERR=yes
-       RUN_ISAPNP=yes
-       PANIC_REBOOT_TIME=0
-       DELAY_LOGIN=yes
-       CLEAN_TMP=no
-       CONSOLE_LOGLEVEL=1
-       SET_SLINKS=yes
-       RUN_LDCONFIG=yes
-fi
-
 # Source function library.
 . /etc/rc.d/init.d/functions
 
 if [ "$argv2" != "chroot" ]; then
        # Now find out what the current and what the previous runlevel are.
-       set $(/sbin/runlevel)
+       set $(runlevel)
        runlevel=$2
        previous=$1
        export runlevel previous
@@ -85,7 +70,7 @@ fi
 # (it can be serial console too)
 if [ "$COLUMNS" -gt 0 ]; then
        if [ "$argv2" != "chroot" ] && ! is_yes "$VSERVER" && \
-          [ "$runlevel" = "0" -o "$runlevel" = "6" ]; then
+               [ "$runlevel" = "0" -o "$runlevel" = "6" ]; then
                CONSOLE=/dev/tty1
                [ -x /usr/bin/chvt ] && /usr/bin/chvt 1 && echo > $CONSOLE
                exec 0<> /dev/console 1>&0 2>&0
@@ -132,13 +117,13 @@ if test "$previous" != "N" ; then
                [ "${1%.rpmnew}" != "${1}" ] && continue
                subsys=${i#/etc/rc.d/rc$runlevel.d/K??}
                [ ! -f /var/lock/subsys/$subsys ] && \
-                   [ ! -f /var/lock/subsys/${subsys}.init ] && continue
+               [ ! -f /var/lock/subsys/${subsys}.init ] && continue
                kscripts=$(( kscripts + 1 ))
        done
        export kscripts
 fi
 
-if test "$previous" == "N" -a "$runlevel" == "5" ; then
+if test "$previous" = "N" -a "$runlevel" = "5" ; then
        export progress=16
        sscripts=$(( $sscripts + 15 ))
 else
@@ -163,8 +148,14 @@ af7=$(termput op)
 text="$(termput op)$(nls '%sResource Manager: %sEntering runlevel number' "$af2" "$af7")"
 text_size="$(nls '%sResource Manager: %sEntering runlevel number' "" "")"
 resp_size="$(nls 'DONE')"
-echo -n "$text"
-awk "BEGIN { for (j=length(\"$text_size\"); j<$INIT_COL+${#resp_size}-${#runlevel}; j++) printf \".\" }"
+{
+       local _len=${#text_size}
+       local _last_col=$(($INIT_COL+${#resp_size}-${#runlevel}))
+       while [ $((_len++)) -lt $_last_col ]; do
+               text="$text."
+       done
+       echo -n "$text"
+}
 echo "${af6}[${af2} $runlevel ${af6}]${af7}"
 
 # Is there an rc directory for this new runlevel?
@@ -182,7 +173,7 @@ if [ -d /etc/rc.d/rc$runlevel.d ]; then
                # Check if the subsystem is already up.
                subsys=${i#/etc/rc.d/rc$runlevel.d/K??}
                [ ! -f /var/lock/subsys/$subsys ] && \
-                   [ ! -f /var/lock/subsys/${subsys}.init ] && continue
+               [ ! -f /var/lock/subsys/${subsys}.init ] && continue
 
                rc_splash "$i stop"
 
@@ -203,7 +194,10 @@ if [ -d /etc/rc.d/rc$runlevel.d ]; then
                # Check if the subsystem is already up.
                subsys=${i#/etc/rc.d/rc$runlevel.d/S??}
                [ -f /var/lock/subsys/$subsys ] || \
-                   [ -f /var/lock/subsys/${subsys}.init ] && continue
+               [ -f /var/lock/subsys/${subsys}.init ] && continue
+
+               # Check if it is managed by upstart
+               use_upstart && [ -f /etc/init/${subsys}.conf ] && continue
 
                # If we're in confirmation mode, get user confirmation
                [ -n "$CONFIRM" ] &&
@@ -264,12 +258,16 @@ rc_splash "master"
 # Say something ;)
 text="$(nls '%sResource Manager: %sRunlevel has been reached' "$af2" "$af7")"
 text_size="$(nls '%sResource Manager: %sRunlevel has been reached' "" "")"
+
+_len=${#text_size}
+_last_col=$(($INIT_COL+${#resp_size}-${#runlevel}))
+while [ $((_len++)) -lt $_last_col ]; do
+       text="$text."
+done
 echo -n "$text"
-awk "BEGIN { for (j=length(\"$text_size\"); j<$INIT_COL+${#resp_size}-${#runlevel}; j++) printf \".\" }"
+unset _len _last_col
+
 echo "${af6}[${af2} $runlevel ${af6}]${af7}"
 unset af2 af6 af7
 
 exit 0
-
-# This must be last line !
-# vi:syntax=sh
This page took 0.036155 seconds and 4 git commands to generate.