LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   After fooling around with sessions a .xsession-errors - but no apparent error! (https://www.linuxquestions.org/questions/linux-software-2/after-fooling-around-with-sessions-a-xsession-errors-but-no-apparent-error-133914/)

Ac. K. 01-12-2004 04:11 AM

After fooling around with sessions a .xsession-errors - but no apparent error!
 
They often say there are no stupid questions, but this one proves the contrary.. Being foolish and too daring does the trick mighty fine. Just bare with the newbie.

Happily fiddling around I noticed the Preferences/Sessions option in the GNOME menu and thought "wow, I guess you can have many neat sessions saved so you can somewhere choose which one of them to open on login". I renamed the default session, which I had set up all nice and tidy for programming and created a new one.

Then I tried logging in again, thinking that at some point or another I would be asked whether I'd perhaps like another session than the default.. But no! Well, being all about learning the insides of my newly discovered free OS I su'd my way to the root account and found the /etc/X11/dm/Sessions directory. The files looked nice and simple so I copied gnome.desktop to a new name, edited the "Exec" part to include the proper switch for choosing a different session.

My new entry showed up in the Sessions menu of the log-in screen, but it didn't work. And as if that wasn't depressing enough, now on every log-in a .xsession-errors gets created with the following contents:

EDIT: the contents are meaningless, normal messages meant for debugging. So the problem is that the file gets created for some reason, even though no error has occurred or the error doesn't have code for actually appending to the file.

What I'd like to know is how to get the thing back to normal so that the file is there only when there HAVE been errors.. And if you're feeling generous, a hint on how my session-switching fantasy could be realized would be very much appreciated as well.

-ack-

Hertattack 01-12-2004 11:35 AM

Ack,

I think you have mixed two thing up .... The sessions you can configure in the Gnome GUI are different from the ones you modified in your /etc directory...

You should return the file in your /etc dir to what it was before you "adjusted" it... And you should take a look in ~/.gnome2/session if I am not mistaken you wil find you renamed session there.

I hope this somehow helps you, if not, perhaps you can state the problem a bit more clearly or send the defective session file.

With regards,
Marcel

Ac. K. 01-13-2004 12:36 AM

Quote:

I think you have mixed two thing up .... The sessions you can configure in the Gnome GUI are different from the ones you modified in your /etc directory...
I'm not sure I have. See, I thought I'd first configure the session in GNOME and then add a new GNOME session choice to the log-in screen Sessions menu, with the "--choose-session=MyNewSession" (or something like that) switch.

Quote:

You should return the file in your /etc dir to what it was before you "adjusted" it...
I can't recall adjusting anything else than the test.desktop that I copied from gnome.desktop in /etc/X11/dm/Sessions.. And that file I of course deleted as soon as I figured it wouldn't work.

Quote:

And you should take a look in ~/.gnome2/session if I am not mistaken you wil find you renamed session there.
Actually I didn't mind losing the saved session, so I made myself a new user account, but the "error" of getting a .xsession-errors persists.

Quote:

I hope this somehow helps you, if not, perhaps you can state the problem a bit more clearly or send the defective session file.
I shouldn't have any defective files in my home directory, as all the files there were created by Fedora on the creation and first use of the new account. So if there's something wrong, it must be in /etc.. But where? I would imagine something in X11 or Gnome (must try going to KDE instead) is setting the "problems" flag or whatever that controls the creation of the .xsession-errors on.

How do I figure out if there's a real problem or not without an error message? Also, I like to check if the file's there whenever an application starts behaving strangely, but now I have to check the file's contents too to see if there's actually anything of interest there.

Hertattack 01-13-2004 02:45 AM

The lines in your .xsession-errors comes from the file /etc/X11/gdm/PreSession/Default which appears to be OK, it is merely debugging information.

This snippet is from from the Default file. You can also find some info in man xdm.
----- 8< -------
if command -v sessreg > /dev/null 2>&1; then
# some output for easy debugging
echo "$0: Registering your session with wtmp and utmp"
echo "$0: running: sessreg -a -w /var/log/wtmp -u /var/run/utmp -x \"$X_SERVERS\" -h \"$REMOTE_HOST\" -l $DISPLAY $USER"

exec sessreg -a -w /var/log/wtmp -u /var/run/utmp -x "$X_SERVERS" -h "$REMOTE_HOST" -l $DISPLAY $USER
# this is not reached
fi
----- 8< -------

However you still have only one session to choose from... I do believe that adding a file to the /etx/X11/Sessions will enable you to choose a different session.

I have copied a file in that dir to another name and it appeared in the list with sessions to choose from.

I don't know if you know this, but you must first type in your username and give <enter> if necessary before you choose the session you want. If you first choose a session an then you type in your username, the previous session will be used.

I hope this will help you a little further,

Marcel

Ac. K. 01-13-2004 03:42 AM

Quote:

The lines in your .xsession-errors comes from the file /etc/X11/gdm/PreSession/Default which appears to be OK, it is merely debugging information.
Of this I was already aware, sorry about forgetting to mention that..

I already tried commenting out the echoes there, but the SESSION_MANAGER line still gets written to the file, so it's not the PreSession script that's creating the file in the first place.. Must be something before it, or then the thing that assigns the session manager. I tried grepping for it in /etc with no luck ... What is this ICE thing about anyway?

Quote:

I don't know if you know this, but you must first type in your username and give <enter> if necessary before you choose the session you want. If you first choose a session an then you type in your username, the previous session will be used.
Hmm, do you mean the GNOME/KDE/Failsafe sessions or the saved sessions? I can go to KDE by choosing it from the Sessions menu and after that writing my username and password.

I'd still like to lose the strange .xsession-errors before trying anything new out with the saved session selection. :scratch:

-ack-

Ac. K. 01-13-2004 03:58 AM

Ok, scratch that about the SESSION_MANAGER: when choosing KDE in the Sessions menu I still get the .xsession-errors file, but with totally different, apparently normal KDE debugging messages. So it really must be something before GNOME and KDE ... I'm just not intimately familiar with how all these things play together. Any suggestions on where to go looking next?

-ack-

Hertattack 01-13-2004 04:31 AM

Perhaps this link will help you:

http://www.tldp.org/HOWTO/XWindow-User-HOWTO/index.html

Ac. K. 01-15-2004 02:01 AM

Realizing I had already put more effort into trying to figure out what was causing the problem than a re-installation would actually take, I finally took out the CDs and went for another try.. Only to find out that even after formatting the partition the "error" remains. So I guess it's a feature and not a configuration problem after all. :rolleyes:

If someone with a freshly installed Fedora Core is reading this, I would appreciate it if you took a looksie in your home directory to see if .xsession-errors is actually created for no reason on your installation too every time a desktop environment is started (or maybe it's the window manager? ... guess I should try installing something else than Metacity as well).

On another note, I got the session switching working with a .desktop file in the /etc/dm/Sessions directory that has the Exec variable set to a symbolic link in my home directory that points to a sh script with sed feeding just the link name to 'gnome-session --choose-session='. I wonder if this is the simplest solution, but on the other hand it requires no editing of system files, just the addition of .desktop files for each session that needs to be choosable, and I suppose there would be no other way to get them into the menu.

Thanks for all the thoughts and the link, Marcel! I bookmarked it for a later read, I'll still have to see about getting rid of the useless error file and understanding what happens between gdm, xdm and Gnome on session start first seems like the way to go. But for now I'm going to stick to something a bit simpler and more suitable for a newbie such as myself. ;)

-ack-


All times are GMT -5. The time now is 05:51 AM.