LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-03-2003, 05:05 PM   #1
yowwww
Member
 
Registered: Apr 2003
Location: Ontario, Canada
Distribution: Arch Linux
Posts: 533

Rep: Reputation: 30
old skool xsession blackbox question


Alright, here are the details...

a buddy of mine has installed red hat 6.2 from cd on to an old P90 box with no kde or gnome so it won't cripple the system. He has blackbox installed but needs to get it added to his xsessions. I have searched this forum and found a couple threads on it, but the info didn't work or at least there are some questions about it.

So, he is in runlevel 3 and I am helping him out with it. How can he get it so he logs in in text mode and then can start blackbox?

TIA
 
Old 08-03-2003, 05:16 PM   #2
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
Run level 3 on RedHat is console text mode. X is started in run level 5.

If you insist on starting X with startx rather than a graphical display manager login (xdm, gdm, kdm, or wdm) then putting blackbox into ${HOME}/.xinitrc should address your problem.

Otherwise if you have your default run level set to 5 and use a graphical display manager, it would go in ${HOME}/.xsession.

No doubt you know that you either put the window manager command at the very end of the file, or start it in the background at the beginning and put a wait command at the end of the file.
 
Old 08-03-2003, 05:29 PM   #3
yowwww
Member
 
Registered: Apr 2003
Location: Ontario, Canada
Distribution: Arch Linux
Posts: 533

Original Poster
Rep: Reputation: 30
maybe i wasn't clear in my post... I KNOW what the difference between runlevel 3 and 5 is, lol.

anyway, a login window would be nice, im sure he wouldnt mind starting in runlevel 5. The trick is to get the login manager to come up and then get blackbox as one of the sessions. He can get xdm to work and it comes up with a spot for his name and password, but it is how to get it to log into blackbox that is the trick. There doesn't seem to be anywhere to do that from the login manager (no 'session' to select or anything).

I am working with him on it now.

Thanks for your response. I am fairly well acquainted with the newer versions, just these archaic ones stump me sometimes.
 
Old 08-03-2003, 05:37 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
find your xdm sessions directory, probably /etc/X11/Sessions, wmsession.d or similar - it'll contain an obvious list of WM's that appear in that list. just copy one of those entries and amend it to point to blackbox, should be simple enough.

hmm that's not what you asked was it.... bugger. tried setting ~/.Xclients-default via switchdesk?

Last edited by acid_kewpie; 08-03-2003 at 05:39 PM.
 
Old 08-03-2003, 05:44 PM   #5
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
If you use xdm, then you will either have to hardcode blackbox in to the ${HOME}/.xsession file, or write a script (in tcl/tk like I did to pop up a window manager selector).

If you install gdm, then that comes ready with a window manager selection menu, the choices being set by the presence of a script file with the name of the window manager in /etc/X11/gdm/Sessions.

So it is your choice as to whether you want to use xdm or gdm, and then address the issue of either a hardcoded window manager or a choice of window manager.
 
Old 08-03-2003, 05:46 PM   #6
Texansfan81
LQ Newbie
 
Registered: Aug 2003
Location: Texas, USA
Distribution: Red Hat, Jamd, College
Posts: 6

Rep: Reputation: 0
Hey guys, I'm the friend of yowwww's that has the computer with the problem. If I can add any information, it's this. Inside /home/paul/ , there is nothing at all. (or it's hidden and I can't see it with ls).

I do have Fvwm running but obviously I would like blackbox or icewm if possible. Thanks for all your help guys.
 
Old 08-03-2003, 05:54 PM   #7
Texansfan81
LQ Newbie
 
Registered: Aug 2003
Location: Texas, USA
Distribution: Red Hat, Jamd, College
Posts: 6

Rep: Reputation: 0
Corin, as far as I can tell, I don't have gdm as an option. xdm is all I can find on this. Because of the age of the system, I am using Red Hat 6.2 with only the X Window System installed (well, other things like networking are installed, but no gnome or kde, that's what I mean). So gdm is out for now.
 
Old 08-03-2003, 07:08 PM   #8
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
Well if you are stuck with xdm, then that is what you will have to use.

Look at /etc/X11/Xsession file and in going through that you should see some tests it does looking in the user's home directory $HOME for a .xsession file (or possibly .xinitrc or possibly .clients). If if finds this file, then the /etc/X11/Xsession either sources or runs that file.

If it runs it, then you will obviously need to make it executable.

In that file you can specify the window manager and any other clients you want to start up at the same time (an X terminal emulator of your choice, xterm, aterm, rxvt, eterm or whatever) being a good choice (plus clock, xbiff, xman whatever).

Do not forget what I said about either starting the wm at the start of the script and putting in a wait at the end (otherwise the script will just go through all the commands and then exit and Xsession is over in a blink of an eye) or putting the window manager right at the end and run it in the foreground.

And, ahem, of course, the .xsession file or whatever, does have to be owned by the user. So if you are doing this as root, do not forget to do a chown.


PS Why he does not upgrade to Red Hat 9 or something else a little more modern? :+)

Last edited by Corin; 08-03-2003 at 07:10 PM.
 
Old 08-03-2003, 08:02 PM   #9
Texansfan81
LQ Newbie
 
Registered: Aug 2003
Location: Texas, USA
Distribution: Red Hat, Jamd, College
Posts: 6

Rep: Reputation: 0
Corin, thank you for your help so far. I am using this old Red Hat 6.2 on this old machine because I think (could be wrong) that I probably can't get 9 on it, even in just text mode. It is an old Pentium-90 mhz, 16 megs memory, and 540 meg drive. Here is the contents of my Xsession file which is located in /etc/X11/xdm/ .

I am posting this file because I don't understand where I should add what. Sorry, but I am a newb as far as blackbox is concerned.

#!/bin/bash -login
# (c) 1999, 2000 Red Hat, Inc.

# 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

xsetroot -solid '#356390'

# clean up after xbanner
if [ -x /usr/X11R6/bin/freetemp ]; then
/usr/X11R6/bin/freetemp
fi

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/Xresources
sysmodmap=/etc/X11/xinit/Xmodmap

# backward compatibility
oldsysresources=/etc/X11/xinit/.Xresources
oldsysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults
if [ -f "$oldsysresources" ]; then
xrdb -merge "$oldsysresources"
fi

if [ -f "$sysresources" ]; then
xrdb -merge "$sysresources"
fi

if [ -f "$userresources" ]; then
xrdb -merge "$userresources"
fi

# merge in keymaps
if [ -f "$sysxkbmap" ]; then
setxkbmap `cat "$sysxkbmap"`
XKB_IN_USE=yes
fi

if [ -f "$userxkbmap" ]; then
setxkbmap `cat "$userxkbmap"`
XKB_IN_USE=yes
fi

if [ -z $XKB_IN_USE -a ! -L /etc/X11/X ]; then
if grep '^exec.*/Xsun' /etc/X11/X > /dev/null 2>&1 && [ -f /etc/X11/XF86Config ]; then
xkbsymbols=`sed -n -e 's/^[ ]*XkbSymbols[ ]*"\(.*\)".*$/\1/p' /etc/X11/XF86Config`
if [ -n "$xkbsymbols" ]; then
setxkbmap -symbols "$xkbsymbols"
XKB_IN_USE=yes
fi
fi
fi

# xkb and xmodmap don't play nice together
if [ -z $XKB_IN_USE ]; then
if [ -f "$oldsysmodmap" ]; then
xmodmap "$oldsysmodmap"
fi

if [ -f "$sysmodmap" ]; then
xmodmap "$sysmodmap"
fi

if [ -f "$usermodmap" ]; then
xmodmap "$usermodmap"
fi
fi

unset XKB_IN_USE

# run all system xinitrc shell scripts.
for i in /etc/X11/xinit/xinitrc.d/* ; do
if [ -x "$i" ]; then
. "$i"
fi
done

# now, we see if xdm/gdm/kdm has asked for a specific environment
case $# in
1)
case $1 in
blackbox)
exec /usr/bin/X11/blackbox
;;
failsafe)
exec xterm -geometry 80x24-0-0
;;
gnome)
exec gnome-session
;;
kde)
exec startkde
;;
anotherlevel)
# we assume that switchdesk is installed.
exec /usr/share/apps/switchdesk/Xclients.anotherlevel
;;
esac
esac

# otherwise, take default action
if [ -x "$HOME/.xsession" ]; then
exec "$HOME/.xsession"
elif [ -x "$HOME/.Xclients" ]; then
exec "$HOME/.Xclients"
elif [ -x /etc/X11/xinit/Xclients ]; then
exec /etc/X11/xinit/Xclients
else
# should never get here; failsafe fallback
exec xsm
fi

Last edited by Texansfan81; 08-03-2003 at 08:35 PM.
 
Old 08-03-2003, 08:37 PM   #10
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
Yo, no reason why RedHat 9 cannot be installed on an old box.

The problem you would have would be in running CPU and memory hogging programs eg full blown KDE.

On RedHat 9 you can still just run XDM and blackbox to keep down CPU and memory usage.

Now like I said, what does it say at the bottom of /etc/X11/Xsession,
which is the system wide Xsession file, not the user Xsession file,

# otherwise, take default action
if [ -x "$HOME/.xsession" ]; then
exec "$HOME/.xsession"
elif [ -x "$HOME/.Xclients" ]; then
exec "$HOME/.Xclients"
elif [ -x /etc/X11/xinit/Xclients ]; then
exec /etc/X11/xinit/Xclients

So write the $HOME/.xsession as per instructions previously posted,
make it executable [it shows you the test -x and does an exec,
not a -r and not . (source)], and make sure it is owned by the user.

I did first suggest doing this in post #2, seven posts ago.

Here is a very meagre suggestion for an Xsession file.


#! /bin/sh
blackbox & wm_pid=${!}
rxvt -bg black -fg white -font 10x20 &
xclock &
wait ${wm_pid}
exit 0


Last edited by Corin; 08-03-2003 at 08:46 PM.
 
Old 08-03-2003, 10:29 PM   #11
Texansfan81
LQ Newbie
 
Registered: Aug 2003
Location: Texas, USA
Distribution: Red Hat, Jamd, College
Posts: 6

Rep: Reputation: 0
I tried getting RH 9 and also 8 on there, but with the 16 megs of RAM, it didn't even make it into the installation part before telling me I couldn't continue because of the low memory.

I created the script as you stated and put it in /home/user/ . I named it .xsession. Oh and I created this while logged in as user, not root.

I do not know how to make this executable. Please demonstrate.

I did a chmod 755 .xsession on it but that did nothing I could see.

When I type blackbox at the prompt, the same error msg occurs: BaseDisplay::BaseDisplay: connection to X server failed.

Hope this information will help. And also I did use your suggestion for the .xsession file exactly word-for-word, just so you know.
 
Old 08-03-2003, 11:03 PM   #12
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
Quote:
Originally posted by Texansfan81
I tried getting RH 9 and also 8 on there, but with the 16 megs of RAM, it didn't even make it into the installation part before telling me I couldn't continue because of the low memory.
With only 16Mb of RAM, it will be a miracle if X works :+)

Quote:
I did a chmod 755 .xsession on it but that did nothing I could see.
That makes it executable to you and anybody else.

If you do an ls -l you will see rwxr-xr-x on it, x meaning it is executable.

Quote:
When I type blackbox at the prompt, the same error msg occurs: BaseDisplay::BaseDisplay: connection to X server failed.
That will be because the X server has not been started, so blackbox cannot connect to a non existent server :+)

I thought that you said that you were using xdm?

So just login as the user from the xdm graphical login screen.

In order to get xdm running by default, you need to set your default run level in /etc/inittab to 5.

If you want to start an X server from one of the virtual consoles, because one is not already running, then you would use the startx command.
 
Old 08-04-2003, 09:15 PM   #13
Texansfan81
LQ Newbie
 
Registered: Aug 2003
Location: Texas, USA
Distribution: Red Hat, Jamd, College
Posts: 6

Rep: Reputation: 0
Corin, I did get blackbox running. Basically the computer starts in runlevel 3, I log in, type xdm, then log in again, and blackbox starts. Thank you for your help with it.

One thing though. When I log out of blackbox, it goes to xdm again, which is fine. But when I log in again as user (as I did before), something very weird happens. It goes back into Blackbox, but only stays for about 5 seconds before it logs out and takes me back to xdm.

So in summary, I can log into blackbox fine the first time, but if I log out, and then try to get back in, it will not work. I made no modifications to the script used beforehand so it's still in this thread here. If you know what might be causing this, I would really appreciate any help you could give me. Thank you sir.
 
Old 08-04-2003, 09:59 PM   #14
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
You should not have your run level set to 3 if you want to run xdm.

Set you run level to 5 in /etc/inittab

Change the line

id:3:initdefault:

to

id:5:initdefault:

Possibly your weird method of starting in run level 3, logging in
as root, then firing up xdm, then logging in as user, may have something
to do with it, but it seems unlikely. I am stumped as to why it should
keep crashing out after 5 seconds.

First of all, make the change above, so you do not ahve to keep logging
in twice (first as root to start xdm, and then as user).

See if it still crashes on logging in for a second time.

If it does, then go to the /etc/X11/Xsession file and add the following lines
to the top of the file, just after the #! /bin/sh

exec 1> ${HOME}/Log_Xsession.${$} 2>
${HOME}/Log_Xsession.${$}
set -x

Then post the contents of $HOME/Log_Xsession here so we can see if there are any clues.
 
Old 08-06-2003, 11:59 AM   #15
Texansfan81
LQ Newbie
 
Registered: Aug 2003
Location: Texas, USA
Distribution: Red Hat, Jamd, College
Posts: 6

Rep: Reputation: 0
Corin, sorry for the delay but I have been pretty busy with non-computer issues lately and also it appears I will be out of town until the weekend now. Thanks again for your help - I will start back again on this little project here after I get back.

I just wanted you to know why I wasn't posting more often, out of concern for you. Thanks man, later.
 
  


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
Seriously Old Skool Against Windows XP SP2 JohnBoy Linux - News 5 06-13-2005 02:58 AM
Going back to skool.. I knead sum advice.. jimispier Programming 5 12-30-2004 09:02 AM
blackbox install question TomGerman Linux - Software 7 08-09-2003 07:35 PM
BlackBox question tarballed Linux - Software 2 04-26-2003 03:01 AM
Quick Blackbox question NSKL Linux - General 1 08-02-2002 09:42 PM


All times are GMT -5. The time now is 01:15 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration