aboutsummaryrefslogtreecommitdiffstats
path: root/prefdm
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2011-11-04 00:22:57 +0000
committerColin Guthrie <colin@mageia.org>2011-11-04 00:22:57 +0000
commit56455f2adfd035d056b949b117776cc9bccf7de3 (patch)
tree6b44c2092aa1c0205e02ba041c1a1e8d0597622c /prefdm
parentb029f180bc237219449bc4a1bea5e7f16b8a3f92 (diff)
downloadinitscripts-56455f2adfd035d056b949b117776cc9bccf7de3.tar
initscripts-56455f2adfd035d056b949b117776cc9bccf7de3.tar.gz
initscripts-56455f2adfd035d056b949b117776cc9bccf7de3.tar.bz2
initscripts-56455f2adfd035d056b949b117776cc9bccf7de3.tar.xz
initscripts-56455f2adfd035d056b949b117776cc9bccf7de3.zip
Reduce unneeded differences to prefdm
Diffstat (limited to 'prefdm')
-rwxr-xr-xprefdm41
1 files changed, 18 insertions, 23 deletions
diff --git a/prefdm b/prefdm
index 44897e51..b5d1db67 100755
--- a/prefdm
+++ b/prefdm
@@ -4,18 +4,20 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin
HOME=/root
export HOME
-# trap SIGTERM to be able to kill autologin
-killed () {
- kill -15 $!
- exit
-}
-
+# xdm-like program are launched from the console, however, the locale-setting
+# can be done in a way that console is not localize, while X11 is.
+# That is handled by the lang.sh script, depending on the existance of
+# $DISPLAY or $DESKTOP variable. Now that $DESKTOP is defined resource lang.sh
+[ -z "$DESKTOP" ] && DESKTOP=dummy_DESKTOP_variable
+# We need to source this so that the login screens get translated
+. /etc/profile.d/10lang.sh
+[ "$DESKTOP" = "dummy_DESKTOP_variable" ] && unset DESKTOP
# Try autologin first, if wanted...
if [ -f /etc/sysconfig/autologin -a -x /usr/sbin/autologin ]; then
- . /etc/sysconfig/autologin
+ . /etc/sysconfig/autologin
if [ -n "$USER" -a "$AUTOLOGIN" = yes ]; then
- # shut down boot splash
+ # shut down boot splash
[ -x /bin/plymouth ] && /bin/plymouth quit
/usr/sbin/autologin &
echo -n $$ > /var/lock/subsys/dm
@@ -55,28 +57,21 @@ if [ -f /etc/sysconfig/desktop ]; then
elif [ -n "$DISPLAYMANAGER" ]; then
dm=$DISPLAYMANAGER
plymouth_quit=yes
- fi
+ fi
fi
-# shut down boot splash if needed (gdm/kdm do it his internally)
+# shut down boot splash
[ -x /bin/plymouth ] && [ "x$plymouth_quit" = "xyes" ] && /bin/plymouth quit
-# xdm-like program are launched from the console, however, the locale-setting
-# can be done in a way that console is not localize, while X11 is.
-# That is handled by the lang.sh script, depending on the existance of
-# $DISPLAY or $DESKTOP variable. Now that $DESKTOP is defined resource lang.sh
-[ -z "$DESKTOP" ] && DESKTOP=dummy_DESKTOP_variable
-# We need to source this so that the login screens get translated
-. /etc/profile.d/10lang.sh
-[ "$DESKTOP" = "dummy_DESKTOP_variable" ] && unset DESKTOP
+shopt -s execfail
preferred=`/etc/X11/lookupdm "$dm"`
+[ -n "$preferred" ] && exec $preferred "$@" >/dev/null 2>&1 </dev/null
-if [ -n "$preferred" ]; then
- $preferred -nodaemon "$@" >/dev/null 2>&1 &
- echo -n $! > /var/run/dm.pid
-fi
+# Fallbacks, in order
+exec gdm "$@" >/dev/null 2>&1 </dev/null
+exec kdm "$@" >/dev/null 2>&1 </dev/null
# catch all exit error
-plymouth quit
+[ -x /bin/plymouth ] && /bin/plymouth quit
exit 1