aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlang.sh5
-rwxr-xr-xrc.d/init.d/functions6
-rwxr-xr-xrc.d/rc57
3 files changed, 42 insertions, 26 deletions
diff --git a/lang.sh b/lang.sh
index 3e485a22..ae02ed01 100755
--- a/lang.sh
+++ b/lang.sh
@@ -46,7 +46,10 @@ if [ "$sourced" = 1 ]; then
[ -n "$LINGUAS" ] && export LINGUAS || unset LINGUAS
[ -n "$_XKB_CHARSET" ] && export _XKB_CHARSET || unset _XKB_CHARSET
- consoletype=$(/sbin/consoletype)
+ consoletype=$CONSOLETYPE
+ if [ -z "$consoletype" ]; then
+ consoletype=$(/sbin/consoletype)
+ fi
if [ -n "$LANG" ]; then
case $LANG in
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index ef7b2d00..bb943963 100755
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -459,8 +459,10 @@ echo_warning() {
# Inform the graphical boot of our current state
update_boot_stage() {
- if [ "$GRAPHICAL" = "yes" -a -x /usr/bin/rhgb-client ]; then
- /usr/bin/rhgb-client --update="$1"
+ if [ "$GRAPHICAL" = "yes" ]; then
+ if [ -x /usr/bin/rhgb-client ]; then
+ /usr/bin/rhgb-client --update="$1"
+ fi
fi
return 0
}
diff --git a/rc.d/rc b/rc.d/rc
index 0dcaefd9..7f44b447 100755
--- a/rc.d/rc
+++ b/rc.d/rc
@@ -27,9 +27,20 @@ export runlevel previous
. /etc/init.d/functions
+export CONSOLETYPE
+cmdline=$(cat /proc/cmdline)
+if ! strstr "$cmdline" rhgb; then
+ GRAPHICAL="no"
+ export GRAPHICAL
+fi
+do_confirm="no"
+if [ -f /var/run/confirm ]; then
+ do_confirm="yes"
+fi
+
# See if we want to be in user confirmation mode
if [ "$previous" = "N" ]; then
- if [ -f /var/run/confirm ]; then
+ if [ "$do_confirm" = "yes" ]; then
echo $"Entering interactive startup"
else
echo $"Entering non-interactive startup"
@@ -51,34 +62,37 @@ fi
# First, run the KILL scripts.
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
+ [ -f /var/lock/subsys/$subsys ] || continue
+ [ -f /var/lock/subsys/$subsys.init ] || continue
+ check_runlevel "$i" || continue
# Bring the subsystem down.
- if LC_ALL=C egrep -q "^..*init.d/functions" $i ; then
- $i stop
- else
- action $"Stopping $subsys: " $i stop
- fi
+ $i stop
done
# Now run the START scripts.
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
+ [ -f /var/lock/subsys/$subsys ] && continue
+ [ -f /var/lock/subsys/$subsys.init ] && continue
+ check_runlevel "$i" || continue
# If we're in confirmation mode, get user confirmation
- if [ -f /var/run/confirm ]; then
+ if [ "$do_confirm" = "yes" ]; then
+ set -x
confirm $subsys
- test $? = 1 && continue
+ rc=$?
+ if [ "$rc" = "1" ]; then
+ continue
+ elif [ "$rc" = "2" ]; then
+ do_confirm="no"
+ fi
+ set +x
fi
update_boot_stage "$subsys"
@@ -87,14 +101,11 @@ for i in /etc/rc$runlevel.d/S* ; do
export LC_ALL=C
exec $i start
fi
- if LC_ALL=C egrep -q "^..*init.d/functions" $i \
- || [ "$subsys" = "single" -o "$subsys" = "local" ]; then
- $i start
- else
- action $"Starting $subsys: " $i start
- fi
+ $i start
done
-rm -f /var/run/confirm
-if [ -x /usr/bin/rhgb-client ] && /usr/bin/rhgb-client --ping ; then
- /usr/bin/rhgb-client --quit
+[ "$do_confirm" = "yes" ] && rm -f /var/run/confirm
+if [ "$GRAPHICAL" = "yes" ]; then
+ if [ -x /usr/bin/rhgb-client ] && /usr/bin/rhgb-client --ping ; then
+ /usr/bin/rhgb-client --quit
+ fi
fi