summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2005-04-15 17:44:24 +0000
committerBill Nottingham <notting@redhat.com>2005-04-15 17:44:24 +0000
commit8986e4b2efaf6df516a813b362a7c26d5f67dcaf (patch)
tree7f2e5b6e0bc970ef43f44f7d4000695cafec8181
parentabd75be1e982ff40055179f66fec5df07ade479e (diff)
downloadinitscripts-8986e4b2efaf6df516a813b362a7c26d5f67dcaf.tar.gz
initscripts-8986e4b2efaf6df516a813b362a7c26d5f67dcaf.tar.xz
initscripts-8986e4b2efaf6df516a813b362a7c26d5f67dcaf.zip
early-login support
-rw-r--r--initscripts.spec6
-rw-r--r--inittab2
-rw-r--r--inittab.s3902
-rwxr-xr-xprefdm37
-rwxr-xr-xrc.d/rc.sysinit4
5 files changed, 42 insertions, 9 deletions
diff --git a/initscripts.spec b/initscripts.spec
index 93fad911..c0cef131 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -85,6 +85,12 @@ if [ $1 = 0 ]; then
fi
fi
+# Handle converting prefdm to run-once
+if fgrep -q "x:5:respawn:/etc/X11/prefdm -nodaemon" /etc/inittab ; then
+ sed --in-place=.rpmsave 's|^x:5:respawn:/etc/X11/prefdm -nodaemon|x:5:once:/etc/X11/prefdm -nodaemon|g' /etc/inittab
+fi
+
+
%preun
if [ $1 = 0 ]; then
/sbin/chkconfig --del netfs
diff --git a/inittab b/inittab
index de9dc70a..9149d729 100644
--- a/inittab
+++ b/inittab
@@ -50,4 +50,4 @@ pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"
6:2345:respawn:/sbin/mingetty tty6
# Run xdm in runlevel 5
-x:5:respawn:/etc/X11/prefdm -nodaemon
+x:5:once:/etc/X11/prefdm -nodaemon
diff --git a/inittab.s390 b/inittab.s390
index 6c0a7ee1..bf94dc68 100644
--- a/inittab.s390
+++ b/inittab.s390
@@ -45,4 +45,4 @@ pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"
1:2345:respawn:/sbin/mingetty console --noclear
# Run xdm in runlevel 5
-x:5:respawn:/etc/X11/prefdm -nodaemon
+x:5:once:/etc/X11/prefdm -nodaemon
diff --git a/prefdm b/prefdm
index 303bfd2d..490e8462 100755
--- a/prefdm
+++ b/prefdm
@@ -2,7 +2,6 @@
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
-
# shut down any graphical boot that might exist
if [ -x /usr/bin/rhgb-client ]; then
/usr/bin/rhgb-client -quit
@@ -26,12 +25,40 @@ fi
shopt -s execfail
-[ -n "$preferred" ] && exec $preferred "$@" >/dev/null 2>&1
+# If we're in early-login mode and something is running, bail out
+if grep -q early-login /proc/cmdline 2> /dev/null ; then
+ if [ -n "$preferred" ]; then
+ pidof $preferred >/dev/null 2>&1 && exit 0
+ fi
+ pidof gdm-binary >/dev/null 2>&1 && exit 0
+ pidof kdm >/dev/null 2>&1 && exit 0
+ pidof xdm >/dev/null 2>&1 && exit 0
+fi
+
+if [ -n "$preferred" ]; then
+ $preferred "$@" >/dev/null 2>&1
+ if [ $? -ne 127 ]; then
+ exec $0 "$@"
+ exit $?
+ fi
+fi
# Fallbacks, in order
-exec gdm "$@" >/dev/null 2>&1
-exec kdm "$@" >/dev/null 2>&1
-exec xdm "$@" >/dev/null 2>&1
+gdm "$@" >/dev/null 2>&1
+if [ $? -ne 127 ]; then
+ exec $0 "$@"
+ exit $?
+fi
+kdm "$@" >/dev/null 2>&1
+if [ $? -ne 127 ]; then
+ exec $0 "$@"
+ exit $?
+fi
+xdm "$@" >/dev/null 2>&1
+if [ $? -ne 127 ]; then
+ exec $0 "$@"
+ exit $?
+fi
# catch all exit error
exit 1
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index 266cac2d..ec78d5a5 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -220,7 +220,7 @@ echo
RHGB_STARTED=0
mount -n /dev/pts
-if strstr "$cmdline" rhgb && [ "$BOOTUP" = "color" -a "$GRAPHICAL" = "yes" -a -x /usr/bin/rhgb ]; then
+if strstr "$cmdline" rhgb && ! strstr "$cmdline" early-login && [ "$BOOTUP" = "color" -a "$GRAPHICAL" = "yes" -a -x /usr/bin/rhgb ]; then
LC_MESSAGES= /usr/bin/rhgb
RHGB_STARTED=1
fi
@@ -496,7 +496,7 @@ if [ -f /etc/rc.modules ]; then
fi
# Start the graphical boot, if necessary and not done yet.
-if strstr "$cmdline" rhgb && [ "$RHGB_STARTED" -eq 0 -a "$BOOTUP" = "color" -a "$GRAPHICAL" = "yes" -a -x /usr/bin/rhgb ]; then
+if strstr "$cmdline" rhgb && ! strstr "$cmdline" early-login && [ "$RHGB_STARTED" -eq 0 -a "$BOOTUP" = "color" -a "$GRAPHICAL" = "yes" -a -x /usr/bin/rhgb ]; then
LC_MESSAGES= /usr/bin/rhgb
RHGB_STARTED=1
fi