MandrivaThis Forum is for the discussion of Mandriva (Mandrake) Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi, wonder if anyone can help me out. X is not starting on boot but it's not the usual problem. My runlevel is set to 5 in /etc/inittab and i can start x manually (i am using it now) so it's all configured properly. I think it is something to do with the start up scripts but i don't know what it could be or how to fix them. So i wondered if anyone could take a look at them?
(think these are the relevent files but if i'm missing any then please say)
# Set a background here because it's not done anymore
# in Xsesion for non root users
if [ "`whoami`" != root ]; then
xsetroot -solid "#21449C"
fi
exec /etc/X11/Xsession $*
/etc/X11/Xsession
Quote:
#!/bin/sh
# Modification for Mandrake Linux by Chmouel Boudjnah <chmouel@mandraksoft.com>
#
# $Id: Xsession,v 1.44 2004/02/05 10:48:48 flepied Exp $
# read the user (~/.i18n) or system-wide (/etc/sysconfig/i18n) i18n settings
. /etc/profile.d/10lang.sh
if [ -z "$GDMSESSION" ]; then
# redirect errors to a file in user's home directory if we can
for errfile in "$HOME/.xsession-errors" "${TMPDIR-/tmp}/xses-$USER" "/tmp/xses-$USER"
do
if ( cp /dev/null "$errfile" 2> /dev/null )
then
chmod 600 "$errfile"
exec > "$errfile" 2>&1
break
fi
done
fi
# Mandrake default background
if [ "`whoami`" = root ]; then
xsetroot -solid "#B20003"
IS_ROOT=1
else
IS_ROOT=
# Load the color only when not called from gdm/kdm
if [ -z "$1" ]; then
xsetroot -solid "#21449C"
fi
fi
xsetroot -cursor_name watch
AGENT=$(type -p ssh-agent)
if [ -x "$AGENT" -a -z "$SSH_AUTH_SOCK" ]; then
if [ -r $HOME/.ssh/identity -o -r $HOME/.ssh2/identification -o -r $HOME/.ssh/id_dsa -o -r $HOME/.ssh/id_rsa ]; then
SSH_AGENT="$AGENT --"
fi
fi
# clean up after xbanner
if [ -f /usr/X11R6/bin/freetemp ]; then
freetemp
fi
# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $userresources ]; then
xrdb -merge $userresources
fi
if [ -f $userresources2 ]; then
xrdb -merge $userresources2
fi
if [ -x /etc/X11/xinit/fixkeyboard ]; then
/etc/X11/xinit/fixkeyboard
fi
if [ -z "$BROWSER" ] ; then
# we need to find a browser on this system
BROWSER=`which mozilla 2> /dev/null`
if [ -z "$BROWSER" ] || [ ! -e "$BROWSER" ] ; then
# not found yet
BROWSER=
fi
fi
if [ -z "$BROWSER" ] ; then
# we need to find a browser on this system
BROWSER=`which netscape 2> /dev/null`
if [ -z "$BROWSER" ] || [ ! -e "$BROWSER" ] ; then
# not found yet
BROWSER=
fi
fi
if [ -z "$BROWSER" ] ; then
# we need to find a browser on this system
BROWSER=`which lynx 2> /dev/null`
if [ -z "$BROWSER" ] || [ ! -e "$BROWSER" ] ; then
# not found yet
BROWSER=
else
BROWSER="xvt -e lynx"
fi
fi
export BROWSER
export HELP_BROWSER="$BROWSER"
# now, we see if xdm/gdm/kdm has asked for a specific environment
if [ $# = 1 ]; then
DESKTOP=$1
else
# use default DESKTOP from config file
# users may want to choose their own desktop
# even when x-session is started by startx command.
# -- Jaegeum --
if [ -f $HOME/.desktop ]; then
. $HOME/.desktop >/dev/null 2>&1
elif [ -f /etc/sysconfig/desktop ]; then
. /etc/sysconfig/desktop >/dev/null 2>&1
fi
fi
# fix .qtrc for Japanese
if [ "$LANG" = ja_JP ]; then
[ ! -d $HOME/.qt ] && mkdir $HOME/.qt
if [ ! -r $HOME/.qt/qtrc ] || ! grep -q '[General]' $HOME/.qt/qtrc; then
cat >> $HOME/.qt/qtrc <<EOF
[General]
XIMInputStyle=Over The Spot
EOF
elif ! grep -q XIMInputStyle $HOME/.qt/qtrc; then
rm -f $HOME/.qt/qtrc.$$
sed "s/\[General\]/[General]\nXIMInputStyle=Over The Spot/" < $HOME/.qt/qtrc > $HOME/.qt/qtrc.$$
mv -f $HOME/.qt/qtrc.$$ $HOME/.qt/qtrc
fi
fi
### Launch an XIM input server if needed
# it must be after definition of DESKTOP variable; but before any
# program that may want user input
if [ -x /etc/X11/xinit/XIM ]; then
. /etc/X11/xinit/XIM
fi
### Launch first time wizard if needed
if [ -z "$IS_ROOT" -a ! -e $HOME/.drakfw ] && type drakfw > /dev/null 2>&1 && touch $HOME/.drakfw > /dev/null 2>&1; then
if [ -x /etc/X11/xinit.d/numlock ]; then
/etc/X11/xinit.d/numlock
fi
xsetroot -cursor_name left_ptr
exec $SSH_AGENT drakfw
fi
# run scripts in /etc/X11/xinit.d
for i in /etc/X11/xinit.d/* ; do
[ -d $i ] && continue
# Don't run ??foo.{rpmsave,rpmorig,rpmnew,~} scripts
[ "${i%.rpmsave}" != "${i}" ] && continue
[ "${i%.rpmorig}" != "${i}" ] && continue
[ "${i%.rpmnew}" != "${i}" ] && continue
[ "${i%\~}" != "${i}" ] && continue
if [ -x $i ]; then
if [ "${DESKTOP}" = default ]; then
SESSION=$(/usr/sbin/chksession -F)
else
SESSION=${DESKTOP}
fi
if grep -q "# to be sourced" $i; then
. $i "${SESSION}"
else
$i "${SESSION}" &
fi
fi
done
if [ -n "$DESKTOP" ]; then
case $DESKTOP in
failsafe)
xsetroot -cursor_name left_ptr
type -p rxvt > /dev/null >& 2 && exec $SSH_AGENT rxvt -geometry 80x24-0-0
type -p xterm > /dev/null >& 2 && exec $SSH_AGENT xterm -geometry 80x24-0-0
type -p xvt > /dev/null >& 2 && exec $SSH_AGENT xvt
type -p twm > /dev/null >& 2 && exec $SSH_AGENT twm
;;
default)
;;
*)
if type -p "$DESKTOP" > /dev/null; then
exec $SSH_AGENT /bin/sh -c "$DESKTOP"
else
exec $SSH_AGENT /bin/sh -c "$(/usr/sbin/chksession -x=$DESKTOP)"
fi
;;
esac
fi
# otherwise, take default action
if [ -x "$HOME/.xsession" ]; then
xsetroot -cursor_name left_ptr
exec $SSH_AGENT "$HOME/.xsession"
elif [ -x "$HOME/.Xclients" ]; then
xsetroot -cursor_name left_ptr
exec $SSH_AGENT "$HOME/.Xclients"
fi
# We may try with chksession
if [ -x /usr/sbin/chksession ];then
#get the first available
SESSION=$(/usr/sbin/chksession -F)
[ -n "$SESSION" -a "$SESSION" != Default ] && exec $SSH_AGENT sh -c "$(/usr/sbin/chksession -x=$SESSION)"
fi
# Argh! Nothing good is installed. Fall back to icewm
if [ -x /usr/X11R6/bin/icewm ];then
exec $SSH_AGENT /usr/X11R6/bin/icewm
else
# gosh, neither icewm is available;
# fall back to failsafe settings
xsetroot -cursor_name left_ptr
xclock -geometry 100x100-5+5 &
xvt -geometry +0+50 &
if [ -x "$BROWSER" -a -f /usr/doc/HTML/index.html ]; then
$BROWSER /usr/share/doc/HTML/index.html &
fi
if [ -x /usr/X11R6/bin/icewm-light ];then
exec $SSH_AGENT icewm-light
elif [ -x /usr/X11R6/bin/twm ];then
exec $SSH_AGENT twm
else
exec $SSH_AGENT xsm
fi
fi
You're correct in that X is started at boot using an init script. However, you don't need to mess around with them if you're using Mandrake. Simply go to Mandrake Control Center -> Boot -> Autologin and check "Launch the graphical environment when your system starts". When you reboot, you should be launched straight into an X-session.
ok, short of re-installing mandrake i do not know how i can fix this problem. It seems that no one else knows either. I have searched for a solution for about 3 days now asking on irc channels, forums and google but have found nothing.
What is your X? I'm running slackware and am not so familiar with mandrake so I know their runleves but you should try with 4 or 5. Don't set it to 0 or 6 though as you will get some problems then with system rebooting and halting as soon as you start up.
Finally i have fixed it. I looked at the inittab file on the computers at uni running redhat and was able to add a few things to mine, which has made it start a dm.
The lines i added to my inittab where,
~~:S:wait:/sbin/sulogin
x:5:respawn:/etc/X11/prefdm -nodaemon
I'm not sure how necessary the first line is maybe ill try it without and see if it still works!!
This has got my display manager running at start up however it would be great if someone could explain to me exactly what those extra lines i have put in do.
Yup i was right you don't need the line '~~:S:wait:/sbin/sulogin'. I also don't need the -nodaemon bit of the 2nd line because i noticed it adds that in the file /etc/X11/prefdm
/etc/X11/prefdm starts the preferred display manager, but that should normally be called from the display manager script /etc/rc.d/init.d/dm, which is called from the service start script /etc/rc.d/rc.
Strange. I presume that you've tried UNchecking the "Launch desktop" box in the Mandrake Control Centre, hitting OK on that, then going back to it and checking it again?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.