Thanks for all your help, but I still haven’t managed to get it fully working.
I still have to start the session manually (over SSH), but I am no longer kicked out when I login… I can keep my current session running!
I guess the next thing for me to do would be to look at how init.d works…. That should solve my problem.
This is what my /etc/gdm/Init/Default file looks like :
Code:
#!/bin/sh
# Stolen from the debian kdm setup, aren't I sneaky
# Plus a lot of fun stuff added
# -George
PATH=/usr/bin:$PATH
OLD_IFS=$IFS
gdmwhich () {
COMMAND="$1"
OUTPUT=
IFS=:
for dir in $PATH
do
if test -x "$dir/$COMMAND" ; then
if test "x$OUTPUT" = "x" ; then
OUTPUT="$dir/$COMMAND"
fi
fi
done
IFS=$OLD_IFS
echo "$OUTPUT"
}
sysresources=/etc/X11/Xresources
# merge in defaults
if [ -f "$sysresources" ]; then
xrdb -merge "$sysresources"
fi
sysmodmap=/etc/X11/Xmodmap
XMODMAP=`gdmwhich xmodmap`
if [ x$XMODMAP != x ] ; then
if [ x$GDM_PARENT_DISPLAY = x ]; then
if [ -f $sysmodmap ]; then
$XMODMAP $sysmodmap
fi
else
( DISPLAY=$GDM_PARENT_DISPLAY XAUTHORITY=$GDM_PARENT_XAUTHORITY $XMODMAP -pke ) | $XMODMAP -
fi
#
# Switch Sun's Alt and Meta mod mappings
#
UNAME=`gdmwhich uname`
PROCESSOR=`$UNAME -p`
if [ x$PROCESSOR = xsparc ]; then
if $XMODMAP | /usr/bin/grep mod4 | /usr/bin/grep Alt > /dev/null 2>/dev/null
then
$XMODMAP -e "clear Mod1" \
-e "clear Mod4" \
-e "add Mod1 = Alt_L" \
-e "add Mod1 = Alt_R" \
-e "add Mod4 = Meta_L" \
-e "add Mod4 = Meta_R"
fi
fi
fi
SETXKBMAP=`gdmwhich setxkbmap`
if [ x$SETXKBMAP != x ] ; then
# FIXME: is this all right? Is this completely on crack?
# What this does is move the xkb configuration from the GDM_PARENT_DISPLAY
# FIXME: This should be done in code. Or there must be an easier way ...
if [ -n "$GDM_PARENT_DISPLAY" ]; then
XKBSETUP=`( DISPLAY=$GDM_PARENT_DISPLAY XAUTHORITY=$GDM_PARENT_XAUTHORITY $SETXKBMAP -v )`
if [ -n "$XKBSETUP" ]; then
XKBKEYMAP=`echo "$XKBSETUP" | grep '^keymap' | awk '{ print $2 }'`
XKBTYPES=`echo "$XKBSETUP" | grep '^types' | awk '{ print $2 }'`
XKBCOMPAT=`echo "$XKBSETUP" | grep '^compat' | awk '{ print $2 }'`
XKBSYMBOLS=`echo "$XKBSETUP" | grep '^symbols' | awk '{ print $2 }'`
XKBGEOMETRY=`echo "$XKBSETUP" | grep '^geometry' | awk '{ print $2 }'`
if [ -n "$XKBKEYMAP" ]; then
$SETXKBMAP -keymap "$XKBKEYMAP"
elif [ -n "$XKBTYPES" -a -n "$XKBCOMPAT" -a -n "$XKBSYMBOLS" -a -n "$XKBGEOMETRY" ]; then
$SETXKBMAP -types "$XKBTYPES" -compat "$XKBCOMPAT" -symbols "$XKBSYMBOLS" -geometry "$XKBGEOMETRY"
elif [ -n "$XKBTYPES" -a -n "$XKBCOMPAT" -a -n "$XKBSYMBOLS" ]; then
$SETXKBMAP -types "$XKBTYPES" -compat "$XKBCOMPAT" -symbols "$XKBSYMBOLS"
elif [ -n "$XKBSYMBOLS" ]; then
$SETXKBMAP -symbols "$XKBSYMBOLS"
fi
fi
fi
fi
# launch X11VNC
sudo /usr/bin/x11vnc -display :0 -bg -usepw -auth /var/lib/gdm/:0.Xauth -o /var/log/x11vnc.log -q
exit 0
Ths is what my /etc/gdm/PreSession/Default file looks like:
Code:
#!/bin/sh
#
# Note that output goes into the .xsession-errors file for easy debugging
#
PATH="/usr/bin:$PATH:/bin:/usr/bin"
OLD_IFS=$IFS
gdmwhich () {
COMMAND="$1"
OUTPUT=
IFS=:
for dir in $PATH
do
if test -x "$dir/$COMMAND" ; then
if test "x$OUTPUT" = "x" ; then
OUTPUT="$dir/$COMMAND"
fi
fi
done
IFS=$OLD_IFS
echo "$OUTPUT"
}
# Set background color
XSETROOT=`gdmwhich xsetroot`
if [ "x$XSETROOT" != "x" ] ; then
CHECKBACKCOLOR="OK"
if [ "x$GDM_GREETER_TYPE" = "xTHEMED" ]; then
BACKCOLOR=`gdmflexiserver --command="GET_CONFIG greeter/GraphicalThemedColor $DISPLAY"`
CHECKBACKCOLOR=`echo $BACKCOLOR | sed 's/^\([^ ]*\) .*$/\1/'`
if [ "x$CHECKBACKCOLOR" = "xOK" ]; then
BACKCOLOR=`echo $BACKCOLOR | sed 's/^.* \(.*\)$/\1/'`
else
BACKCOLOR=""
fi
fi
# If we tried to load the themed backgroundcolor, but failed, then try loading plain color
if [ "x$CHECKBACKCOLOR" != "xOK" ] || [ "x$GDM_GREETER_TYPE" = "xPLAIN" ]; then
# Background type can be 0=None, 1=Image & Color, 2=Color, or 3=Image
BACKTYPE=`gdmflexiserver --command="GET_CONFIG greeter/BackgroundType $DISPLAY"`
# Skip if background type does not include a color
if [ "x$BACKTYPE" = "xOK 1" ] || [ "x$BACKTYPE" = "xOK 2" ]; then
BACKCOLOR=`gdmflexiserver --command="GET_CONFIG greeter/BackgroundColor $DISPLAY"`
CHECKBACKCOLOR=`echo $BACKCOLOR | sed 's/^\([^ ]*\) .*$/\1/'`
if [ "x$CHECKBACKCOLOR" = "xOK" ]; then
BACKCOLOR=`echo $BACKCOLOR | sed 's/^.* \(.*\)$/\1/'`
else
BACKCOLOR=""
fi
fi
fi
# Default value
if [ "x$BACKCOLOR" = "x" ]; then
BACKCOLOR="#76848F"
fi
"$XSETROOT" -cursor_name left_ptr -solid "$BACKCOLOR"
fi
# launch x11
sudo /usr/bin/x11vnc -display :0 -bg -usepw -auth /var/lib/gdm/:0.Xauth -o /var/log/x11vnc.log -q
exit 0
Any ideas why the command isint launching?
Bookmarks