LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 05-02-2004, 06:42 PM   #1
cootetom
Member
 
Registered: May 2004
Location: UK
Distribution: Ubuntu
Posts: 96

Rep: Reputation: 15
X not starting on boot (init scripts)


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)

/etc/X11/xinit/xinitrc
Quote:
#!/bin/sh
# (c) 2000-2002 MandrakeSoft
# $Id: xinitrc-xinitrc,v 1.2 2002/09/10 05:53:43 flepied Exp $

# 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

userresources=$HOME/.Xresources
userresources2=$HOME/.Xdefaults
sysresources=/etc/X11/Xresources

# 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
thanks
 
Old 05-02-2004, 10:15 PM   #2
coalquay404
LQ Newbie
 
Registered: Oct 2003
Distribution: SuSE
Posts: 22

Rep: Reputation: 15
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.
 
Old 05-03-2004, 02:57 AM   #3
cootetom
Member
 
Registered: May 2004
Location: UK
Distribution: Ubuntu
Posts: 96

Original Poster
Rep: Reputation: 15
yep that option is already checked but it still doesn't boot into an x-session.
 
Old 05-03-2004, 04:36 AM   #4
equinox
Member
 
Registered: Dec 2003
Location: Johannesburg, South Africa
Posts: 846

Rep: Reputation: 30
have u got a dm installed?
 
Old 05-03-2004, 10:12 AM   #5
cootetom
Member
 
Registered: May 2004
Location: UK
Distribution: Ubuntu
Posts: 96

Original Poster
Rep: Reputation: 15
I have mdkkdm, kdm and xdm i would like mdkkdm to load at start up.
 
Old 05-04-2004, 05:45 AM   #6
cootetom
Member
 
Registered: May 2004
Location: UK
Distribution: Ubuntu
Posts: 96

Original Poster
Rep: Reputation: 15
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.

: (

- Tom

 
Old 05-04-2004, 08:37 AM   #7
Grymme
Member
 
Registered: Apr 2004
Location: Sweden
Distribution: Slackware
Posts: 44

Rep: Reputation: 15
Are you running the correct runlevel for init?

If you look in your /etc/inittab file at the line

id:X:initdefault:

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.
 
Old 05-04-2004, 09:20 AM   #8
Dave Farrance
Member
 
Registered: May 2004
Location: UK
Distribution: Mandrake 10.0
Posts: 47

Rep: Reputation: 15
He said he's on runlevel 5. Strange. It can't be too badly broken if startx works.

Maybe try "init 3", reboot, then try "init 5" again?
 
Old 05-04-2004, 12:53 PM   #9
cootetom
Member
 
Registered: May 2004
Location: UK
Distribution: Ubuntu
Posts: 96

Original Poster
Rep: Reputation: 15
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.

Thanks
 
Old 05-04-2004, 01:15 PM   #10
cootetom
Member
 
Registered: May 2004
Location: UK
Distribution: Ubuntu
Posts: 96

Original Poster
Rep: Reputation: 15
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
 
Old 05-05-2004, 05:40 AM   #11
Dave Farrance
Member
 
Registered: May 2004
Location: UK
Distribution: Mandrake 10.0
Posts: 47

Rep: Reputation: 15
/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?
 
Old 05-05-2004, 08:37 AM   #12
cootetom
Member
 
Registered: May 2004
Location: UK
Distribution: Ubuntu
Posts: 96

Original Poster
Rep: Reputation: 15
Yes i tried that, it is very strange why it doesn't work the way it should!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
init scripts lvgandhi Debian 2 10-11-2005 02:44 AM
starting named on boot without init scripts evilchild SUSE / openSUSE 1 03-05-2005 07:46 AM
New init scripts? xconspirisist Fedora 9 12-09-2004 11:41 AM
Scripts in /etc/rc.d/init.d correro Linux - General 1 03-13-2003 09:47 PM
slack init scripts gui10 Slackware 11 05-15-2002 11:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 08:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration