#
# 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
[ -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
[ -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
# (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
[ "${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
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?
# 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"
# 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" ] &&
# 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