LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-31-2006, 05:22 AM   #1
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
System crashes when leaving init 4


My custom Slackware install crashes whenever I leave init 4 and I can't quite figure out what is causing it. I was able to ignore the problem for awhile, but now I am working on a project that requires me to keep entering and exiting xwindows, and having to reboot (uncleanly) is getting increasingly annoying.

I am pretty sure the problem is with the init process and not X11 because it doesn't happen when I initiate startx from init 3. If however, I go strait into init 4, my screen blanks whenever I try to exit the xsession and it will not accept any further input. It will even stop in the middle of an 'init 6' run from an xterm.

Initially I was using XDM and fluxbox, and I would only experience this when I had to exit X uncleanly (VT switching or a call to init 3 from xterm). Now I have KDM with fluxbox, and I get the results no matter how I try to exit. This is another reason why I belive it is being cause by an incorrect desktop manager setup.

Unfortunately, I am still haven't completely figured out how all this xsession stuff works so I'm not sure what to post.

Here is some general info about my install.

xwindows packages (the K's mean it is not a standard Slackware pkg):
Code:
dejavu-ttf-2.10-noarch-1.tgz    x11-6.9.0-i486-11.tgz
flash_plugin-9.0.21.55-noarch-K1.tgz  x11-fonts-100dpi-6.9.0-noarch-5.tgz
fluxbox-1.0rc2-i486-K1.tgz            x11-fonts-misc-6.9.0-noarch-5.tgz
fontconfig-2.2.3-i486-2.tgz           x11-fonts-scale-6.9.0-noarch-5.tgz
kdelibs-3.5.4-i486-1.tgz              xpdf-3.01-i486-4.tgz
kdm-3.5.4-i686-K1.tgz                 xscreensaver-5.00-i486-1.tgz
mozilla-firefox-1.5.0.7-i686-1.tgz    xv-3.10a-i486-4.tgz
qt-3.3.6-i486-4.tgz
xorg.conf is stalk.

/opt/kde/share/config/kdm/kdmrc:
Code:
# KDM master configuration file

[General]
ConfigVersion=2.3
StaticServers=:0
ReserveServers=:1,:2,:3
ServerVTs=-7
ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6
PidFile=/var/run/kdm.pid

[Xdmcp]
Enable=false
Xaccess=/opt/kde/share/config/kdm/Xaccess
Willing=/opt/kde/share/config/kdm/Xwilling

[Shutdown]
HaltCmd=/sbin/poweroff
RebootCmd=/sbin/reboot
BootManager=Lilo

[X-*-Core]
Setup=/opt/kde/share/config/kdm/Xsetup
Startup=/opt/kde/share/config/kdm/Xstartup
Reset=/opt/kde/share/config/kdm/Xreset
Session=/opt/kde/share/config/kdm/Xsession
SystemShell=/bin/bash
AllowRootLogin=true
AllowNullPasswd=false
AllowShutdown=Root
ClientLogFile=.xsession-errors-%s

[X-*-Greeter]
ColorScheme=Plastik
LogoArea=Logo
LogoPixmap=/opt/kde/share/apps/kdm/pics/ox80.ico
AntiAliasing=true
GreetFont=DejaVu Sans,20,-1,5,50,0,0,0,0,0
StdFont=DejaVu Sans,10,-1,5,50,0,0,0,0,0
FailFont=DejaVu Sans,10,-1,5,75,0,0,0,0,0
NumLock=On
UserList=true
ShowUsers=NotHidden
HiddenUsers=root
MinShowUID=500
MaxShowUID=65000
PreselectUser=Previous
FocusPasswd=true
EchoMode=OneStar
BackgroundCfg=/opt/kde/share/config/kdm/backgroundrc
ForgingSeed=1159147479
AllowConsole=false
Preloader=/opt/kde/bin/preloadkde
Theme=/opt/kde/share/apps/kdm/themes/circles

[X-:*-Core]
ServerCmd=/usr/X11R6/bin/X -br
ServerArgsLocal=-nolisten tcp
AllowNullPasswd=true
AllowShutdown=All

[X-:*-Greeter]
PreselectUser=Previous
FocusPasswd=true
LoginMode=LocalOnly
AllowClose=false

[X-:0-Core]
AutoLoginEnable=false
AutoLoginAgain=false
AutoLoginDelay=0
AutoLoginUser=webuser
ClientLogFile=.xsession-errors

[X-:0-Greeter]
#nothing
/mnt/kiox/opt/kde/share/config/kdm/Xsession
Code:
#! /bin/sh
# Xsession - run as user

# Merged in parts of the old Xsession to load defaults from
# Xresources and Xmodmap files, 2006-02-09 volkerdi

session=$1

# This section is borrowed from the old X11 Xsession file:
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/usr/X11R6/lib/X11/xinit/.Xresources
sysmodmap=/usr/X11R6/lib/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -r $sysresources ]; then
        /usr/X11R6/bin/xrdb -merge $sysresources
fi
if [ -r $sysmodmap ]; then
        /usr/X11R6/bin/xmodmap $sysmodmap
fi
if [ -r $userresources ]; then
        /usr/X11R6/bin/xrdb -merge $userresources
fi
if [ -r $usermodmap ]; then
        /usr/X11R6/bin/xmodmap $usermodmap
fi

# Note that the respective logout scripts are not sourced.
case $SHELL in
  */bash)
    [ -z "$BASH" ] && exec $SHELL $0 "$@"
    set +o posix
    [ -f /etc/profile ] && . /etc/profile
    if [ -f $HOME/.bash_profile ]; then
      . $HOME/.bash_profile
    elif [ -f $HOME/.bash_login ]; then
      . $HOME/.bash_login
    elif [ -f $HOME/.profile ]; then
      . $HOME/.profile
    fi
    ;;
  */zsh)
    [ -z "$ZSH_NAME" ] && exec $SHELL $0 "$@"
    emulate -R zsh
    [ -d /etc/zsh ] && zdir=/etc/zsh || zdir=/etc
    zhome=${ZDOTDIR:-$HOME}
    # zshenv is always sourced automatically.
    [ -f $zdir/zprofile ] && . $zdir/zprofile
    [ -f $zhome/.zprofile ] && . $zhome/.zprofile
    [ -f $zdir/zlogin ] && . $zdir/zlogin
    [ -f $zhome/.zlogin ] && . $zhome/.zlogin
    ;;
  */csh|*/tcsh)
    # [t]cshrc is always sourced automatically.
    # Note that sourcing csh.login after .cshrc is non-standard.
    xsess_tmp=`mktemp`
    $SHELL -c "if (-f /etc/csh.login) source /etc/csh.login; if (-f ~/.login) source ~/.login; /bin/sh -c export > $xsess_tmp"
    . $xsess_tmp
    rm -f $xsess_tmp
    ;;
  *) # Plain sh, ksh, and anything we don't know.
    [ -f /etc/profile ] && . /etc/profile
    [ -f $HOME/.profile ] && . $HOME/.profile
    ;;
esac

[ -f /etc/xprofile ] && . /etc/xprofile
[ -f $HOME/.xprofile ] && . $HOME/.xprofile

case $session in
  "")
    exec xmessage -center -buttons OK:0 -default OK "Sorry, $DESKTOP_SESSION is no valid session."
    ;;
  failsafe)
    exec xterm -geometry 80x24-0-0
    ;;
  custom)
    exec $HOME/.xsession
    ;;
  default)
    exec /usr/X11/bin/startfluxbox
    ;;
  *)
    eval exec "$session"
    ;;
esac
exec xmessage -center -buttons OK:0 -default OK "Sorry, cannot execute $session. Check $DESKTOP_SESSION.desktop."
/etc/inittab
Code:
# These are the default runlevels in Slackware:
#   0 = halt
#   1 = single user mode
#   2 = unused (but configured the same as runlevel 3)
#   3 = multiuser mode (default Slackware runlevel)
#   4 = X11 with KDM (requires password at boot)
#   5 = X11 loaded at system init with no password
#   6 = reboot

# Default runlevel. (Do not set to 0 or 6)
id:4:initdefault:

...<SNIPED SLACKWARE DEFAULT>...

# Runlevel 4
x1:4:respawn:/etc/rc.d/rc.4

# Runlevel 5
x2:5:respawn:/etc/rc.d/rc.5
~/.fluxbox/startup
Code:
# fluxbox startup-script:

/usr/X11R6/bin/fbsetroot -solid black

aoss firefox &

exec /usr/X11R6/bin/fluxbox
Nothing interesting in X.org log, but not sure what this was in the kdm.log:
Code:
X Window System Version 6.9.0
Release Date: 21 December 2005
X Protocol Version 11, Revision 0, Release 6.9
Build Operating System: Linux 2.4.33.3 i686 [ELF]
Current Operating System: Linux webclient 2.6.15 #1 SMP Sat Dec 30 20:15:36 Local time zone must be set--see zic  i686
Build Date: 16 September 2006
        Before reporting problems, check http://wiki.X.Org
        to make sure that you have the latest version.
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sun Dec 31 01:59:45 2006
(==) Using config file: "/etc/X11/xorg.conf"
Could not init font path element /usr/X11R6/lib/X11/fonts/CID/, removing from list!
QImage::convertDepth: Image is a null image
QImage::smoothScale: Image is a null image
Sorry if this was all useless info, but I'm not sure where to even begin. Any guidance will be greatly appreciated.

Thanks!
...aaron

**edit**
one last thing, all packages from l/ are installed.

**edit again**
Also, if anyone is interested in browsing the current directory tree for this project, it can be found at:

http://www.splashlabs.com/dev/kiox-current/

I am uploading the most recent build which containts this bug. It should finish uploading in a couple hours from the time I posted this thread.

Last edited by drkstr; 12-31-2006 at 05:46 AM.
 
Old 12-31-2006, 08:37 AM   #2
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
What about using startx or xinit instead of init 5?
 
Old 12-31-2006, 01:11 PM   #3
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Original Poster
Rep: Reputation: 45
init 5 works just fine (which does use startx).

Code:
#! /bin/sh
#
# rc.5          This file switches to the webuser and loads X11
#               with no password. Use rc.4 for a passworded login.
#               If the default username of "webuser" is not used,
#               you will need to update this file.
#
#
# Made for Kiox Linux by Aaron Miller (amiller@splashlabs.com)
#

# change this to the user you want to automaticly login when system boots
# (requires default run level 5 in /etc/inittab)
WEBUSER="webuser"

HOME="/home/$WEBUSER"
PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin:/opt/kde/bin"

sudo -u $WEBUSER /bin/bash /usr/X11R6/bin/startx
My problem is with init 4.

This is for a custom kiosk system my company will be using for POS software so I will not be able to release something with such a huge bug. Otherwise I would have just worked around it as you suggested

Thanks!
...aaron

**edit**
By the way, Kiox Linux is essentially a custom Slackware build, but Pat's License prevents me from calling it so.

Last edited by drkstr; 12-31-2006 at 01:29 PM.
 
Old 12-31-2006, 01:32 PM   #4
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
And if you login as root and run an X session with KDM and login into it as user, does it break the same way?
 
Old 12-31-2006, 01:53 PM   #5
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Original Poster
Rep: Reputation: 45
Good suggestion! I didn't think to try that. Unfortunatly, I got the same results. Logged in as root, opened xterm and ran 'init 3'. Screen blanks with no chance of recovery.

My hard disks are starting to hate me, I had to grab a boot CD and rerun lilo to recover this time.

Next time I will not mount all my other partitions (including my primary install partition) in my test system.

...aaron
 
Old 12-31-2006, 04:00 PM   #6
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
I've played quite a bit with WDM using init 4. I found I could safely exit runlevel 4 by just running 'init 5' from an xterm. Should dump you CLI login.
 
Old 12-31-2006, 04:08 PM   #7
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
And at least going to text console or doing Ctrl-Alt-BackSpace works?
 
Old 12-31-2006, 04:38 PM   #8
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Original Poster
Rep: Reputation: 45
Problem solved. Thank you both for your help!

To try out gnashley's suggestion, I replaced my custom inittab with the stalk Slackware inittab. After that, I could cleanly exit any way I chose. I didn't realize the inittab was the problem, because it was working fine with XDM. I could use runlevel 4 for password login, and my custom implemented runlevel 5 for an auto login.

So this asks the question, why does KDM not like runlevel 5 to be implemented? Did I perhaps do it incorrectly and XDM just didn't really care as much?

I don't really know how to set up a custom runlevel 5, so I just guessed and it appeared to be working (until now obviously).

Code:
# Runlevel 4
x1:4:respawn:/etc/rc.d/rc.4

# Runlevel 5
x2:5:respawn:/etc/rc.d/rc.5
See previous post for rc.5 script.


I guess it's not to important since I was planning to eventually phase this out and use KDM's auto login feature. But I am still curious to know how one would correctly implement their own runlevel.


Thanks again for all the help and suggestions!
...aaron
 
Old 01-01-2007, 03:27 AM   #9
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
I've used 5 the same way you show, except for use with WDM, which is similar to XDM. I currently boot using init 4, but rc.4 is modified with an entry before XDM to use WDM instead. I use a standard inittab with default init 3 and pass the init 4 as a boot option.
After login I can run an xterm as root or with su and from there run 'init 5'. It dumps you back to the CLI login, as if rc.4 had not run and no login had occurred. If you really need to be in runlevel 3 you can run 'init 3' after 'init 5'. If you have runlevel 5 setup as you do, this might not work. But I get the same behaviour of locking up when trying to go directly from runlevel 4 to 3.
You might find some useful stuff here:
http://distro.ibiblio.org/pub/linux/...jects/AFX-wdm/
 
  


Reply



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
system freezes when leaving X Rocker Linux - Software 11 10-27-2004 01:50 PM
System hangs,if gives init 3 or init 4 Sailaja Reddy Red Hat 1 09-20-2004 01:31 AM
Redhat linux9.0:System hangs,if gives init 3 or init 4 Sailaja Reddy Linux - Newbie 4 09-16-2004 03:19 AM
system crashes when using init 3 BrummieJim Linux - Newbie 1 05-16-2004 07:15 PM
Slack 9.1 shuts down leaving file system dirty wartstew Slackware 3 10-15-2003 07:47 PM

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

All times are GMT -5. The time now is 09:57 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