Help - Search - Members - Calendar
Full Version: X Server Runing
Linuxhelp > Support > Technical Support
nifflerX
Hi,

I've recently installed Red Hat Enterprise WS version 3 on two different machines and I get the same problem on both. When I log out I get an error message (posted below) that tells me there is already an X server running, and it asks me if it should start another session on a new display or kill the current one and start the session here. If I tell it to start the session on the current display the session starts up with no problems. What I'm trying to find is how I can tell the machine to start the session on display :0 (the default display) without asking the user after each log out. Does anyone know what I have to change to get this to work? Thanks so much.


Message recieved after logging out:
"There already appears to be an X server running on display :0. Should I try another display nubmer? If you anser no, I will attempt to start the server on :0 again. (You can change consoles by pressing Ctrl-Alt plus a function key such as Ctrl-Alt-F7 to go to console 7. X servers are usually run on consoles 7 or higher.)"


-NifflerX
Hemant
Though..this is no solution..but just check out XFreeconfig..
if there is something..related on what display X is started...
I am replying from a window machine...So i will check and see to it...

Usually..this is not a comman problem..Usually i get such an error..only when i have X running on some display..and i try to restart X..on different...one..without killing the one which is already running.

I wonder if that is case with you...
nifflerX
I checked my XFree86 config file and I compared the file with one on a machine running Red Hat 8.0 (which doesn't have this problem) and the files looked pretty similar. Also, I couldn't see anything that mentioned the display or anything about forcing a restart of the X server. It's entriely possible that I missed something as I don't have a great deal of knowledge with X servers. Thanks for the recommendation though. Does anyone have any other ideas what the problem might be? Thanks so much.


-NifflerX
Hemant
Again..no sure solution..But as GDM is used in case of Redhat for logging into Linux..
checkout...this file..
/etc/X11/gdm/gdm.conf
ohmy.gif Again i am not sure about the path...
and also..
/etc/X11/xdm/Xsession..

these files..will give you a clue where is the problem....
nifflerX
The line

AlwaysRestartServer=

in /etc/X11/gdm/gdm.conf was set to false, so I've reset that to true, but I won't be able to restar the machine for a little bit. I'll report back after I reboot. If you think I'm barking up the wrong tree here, please let me know. The value next to AlwaysRestartServer was set to false on some of my Red Hat 8.0 machines that reset the X server anyway, but I'm thinking there might have been some change in Enterprise in this regard. Thanks so much.


-NifflerX
nifflerX
So I was finally able to restart my machine, but when I logged out again I still got the same error message. Does anyone have any other ideas that I might be able to try. Thanks so much.



-NifflerX
Robert83
Hi,

I'm just installing Fedora Core 1 on one of my terminal server client computer, and I was searching the web meanwhile,
and found this post, that solved the problem for the guy [it might work for you to] :
QUOTE
I literally have EXACTLY the same problem and started 3 days ago after a reboot also. Something has gotten obviously corrupted but have not figured out exactly what. So far, the following has worked for me to at least start troubleshooting.

1. When the error of the "There already appears to be an X server running on display :0. "... shows up, hit [NO]. Then hit CTRL-ALT-F6 (might take a few times) until it kicks you back to a console. (When I hit [YES] the first 10 tries or so, X would attmept to start it again with no success)

2. At the login prompt, log in as root
3. Type "xf86cfg" and go through the process of configuring X again. Afterwards, run "xwmconfig" to tell it which wm to use as default.
4.. Once X is configured again, you should be able to manuall start X as root.
5. It should open your default WM (I use KDE). Then you can open an editor and edit your etc/inittab/ and make it default to 3 at for now (if not, you will get stuck in the endless loop of the X server error you are having.)
6. Open your /etc/X11/XFree86.config and see that the info is correct for your graphics card, mouse, keyboard and monitor.
7. If you can not start X manually at all even after configuring it, just open the file from runlevel3 with your favorite editor.


it is also quiet possible that if you upgrade your system to the latest, this problem will stop.

Sincerely
Robert B
nifflerX
Thanks for the reply. However, I don't have either xf86cfg or xwmconfig on my machine anywhere. I did a find / -name 'xf86cfg' and came up empty. Is there some other command that does the same thing? Also, what did you mean by update my system to the latest? I'm currently running kernel 2.4.21-9.0.1.ELsmp and my red hat account says I don't have anything left that I can upgrade? Am I missing some third-party stuff that I should have or is Red Hat lying to me? Thanks so much.


-NifflerX
Robert83
Hi,

no I was trying to tell you, if you have not updated your system , then do it. But if you are using the latest stuff that's
okay.

Sincerely
Robert B
Robert83
Hi,

you can do this to, to make X11 configure itself [ask you to configure it].

copy your /etc/X11/XF86Config file to /home [as a backup]

goto runlevel 3 [non X11 mode]
after you are done with this, delete your /etc/X11/XF86Config
and type startx , it will tell you that it failed to start X , do you want to configure it , choose yes


Sincerely
Robert B
Robert83
Hi,

first I MUST Apologize for that last post...

I forgot to tell you...

1. backup XF86Config
2. use runlevel 3 [non X mode]
3. delete /etc/X11/XF86Config
4. change your /etc/inittab to id:5 again
5. reboot
6. X will not start, it will complain about not finding a display, and after a few seconds
it will tell you , do you wan't a detailed log [blablabla] about the error, and after that
do you want to try to configure X again. Do it.
7. And it will run

[This worked for me on Whitebox, and now on this Fedora Core 1 latest updates both]

Sincerely
Robert B
nifflerX
Hi,

So I've found away around a the problem and now I need just a little bit more help. When I log in a file called .X0-lock is created in /tmp. As long as that file is there when I log off I get the error message. However if I move it out of that folder then my login window comes up without a problem. Is there a way to have a script run when a user logs off? The script I'd have it run is really simple,

rm -f /tmp/.X0-lock

but I need it to run only at log off. I suppose I could have it run at login but it seems to me that it was put there for a reason and I only don't want it there when the user logs off. Does anyone know how do create this "log off" script? Also, if I'm doing something really stupid that could harm my machine by playing with this file, please let me know. Thanks so much.

-NifflerX

p.s. Just a quick note the file is owned by root, and not all users will have sudo permissions so I need something that runs as root. Thanks again so much.
Robert83
Hi,

I found the place where you can put it smile.gif smile.gif smile.gif

/etc/X11/gdm/PostSession/Default

modify Default as you need


add the line : rm -f /tmp/.X0-lock

you should put it before the line exit 0

Sincerely
Robert B

ps.: back up that file before changing things!
nifflerX
Hi,

Thanks for the reply. I've edited that file, (/etc/X11/gdm/PostSession/Default) but it still seems like it's not getting read at logoff. I've tried running it as root when I'm logged on, and it does what it's suppose to do. I've even added some simple touch commands to make sure it's been run. However, when I log off it's not called. I checked and my session is Default (GDMSESSION=Default). Is there something I need to set to make the PostSession/Default run that might be turned off by default? Thanks so much.

I'm not sure if this makes a difference but I just check and I have gdm-2.4.1.6-2 installed.

-NifflerX
nifflerX
I've also tried adding stuff to my ~/.logout file. I don't know if that would work in the end, but that only is enacted if I log in in text mode only. Then when I log out that file gets run. I'm wondering if the way I start up KDE, I believe it's the default way as I haven't changed it, it's preventing PostSession/Default from running? Thanks again.


-NifflerX
Robert83
Hi,

I just did it with Fedora Core 1[ latest updates,kernel]

cd /home
touch robi

and my default looks like this

CODE
#!/bin/sh

PATH="/usr/bin/X11:/usr/X11R6/bin:/opt/X11R6/bin:$PATH:/bin:/usr/bin"

rm -f /home/robi

SESSREG=`which sessreg 2>/dev/null`
if [ "x$SESSREG" != "x" ]; then
    "$SESSREG" -d -w /var/log/wtmp -u /var/run/utmp -x "$X_SERVERS" -h "$REMOTE_HOST" -l "$DISPLAY" "$USER"
fi
exit 0

then try putting it above the SESSREG

it should work for you to, you added the path for the file correcly , and the name of the file?
it works for me
Sincerely
Robert B
Robert83
Hi,

rm -f /tmp/.X0-lock

now the problem is, it ether 0[zero] or O , it looks alike when I type it in a terminal windows [using the default fonts]


Sincerely
Robert B
nifflerX
Still gave me the error message. Here is the entire contents of my /etc/X11/gdm/PostSession/Default file:

#!/bin/sh

PATH=/usr/bin/X11:/usr/X11R6/bin:/opt/X11R6/bin:$PATH

/bin/rm -f /tmp/.X0-lock

if command -v sessreg > /dev/null 2>&1; then
sessreg -d -w /var/log/wtmp -u /var/run/utmp -x "$X_SERVERS" -h "$REMOTE_HOST" -l $DISPLAY $USER
fi
exit 0

And I believe it's a zero because if I become root and run Default it gets rid of the .X0-lock file. It's only when I log off without running Default manually that the file doesn't get erased. Thanks so much.

-NifflerX
nifflerX
So I had a thought and I was wondering if anyone knew if this was a bad idea. If I put the rm -f /tmp/.X0-lock into xdm/Xsetup_0 then the .X0-lock file is deleted and when the user logs out they don't get the error message. My question then becomes if if the /tmp/.X0-lock file is needed by anything or if I can run my normal session without. Any and all ideas or thoughts would be more than welcome. Thanks so much.


-NifflerX
Robert83
Hi,

I found out how to remove it with /etc/X11/gdm/PostSession/default

add the lines like this

cd /tmp
chmod 666 .X0-lock
rm -f .X0-lock

it worked for me

Sincerely
Robert B
nifflerX
Didn't work. Maybe the problem is that it runs PostSession/Default after the error message pops up? Is that a possibility? I don't know the order that things happen when I log off. But if I look in /var/log/messages it does say that 'Display :0 is busy. There is another X server running already.' it just doesn't say much else about the logging of process. Thanks so much.


-NifflerX
nifflerX
I get the feeling that PostSession doesn't run at all for me. I've added some touch commands and after logging off those files aren't created. I've tried modifying TakeConsole, because I read that PostSession/Default used to be a symlink to it (on my system it is its own file). I'm wondering if this has something to do with the fact that all my users log in via ldap authentication, but I don't really believe that is the problem, because logging in and out as root doesn't solve the problem. Does anyone know if there is a way to check and ensure that PostSession/Default is running? If not, does anyone know if it is a security risk to remove /tmp/.X0-lock at the beginning of a session, because if I add the remove command to Xsetup_0 then the file is erased, but is done so at login, not logout. Thanks so much.


-NifflerX
hughesjr
Are you sure you are using gdm and not xdm or kdm as your display manager.

do this command;

ps -ef | grep gdm

Mine shows this:

CODE
root      3255     1  0 Apr04 ?        00:00:00 /usr/bin/gdm-binary -nodaemon
root      3310  3255  0 Apr04 ?        00:00:00 /usr/bin/gdm-binary -nodaemon
root      4461  3310  0 Apr04 ?        01:01:53 /usr/X11R6/bin/X :0 -auth /var/gdm/:0.Xauth vt7
nifflerX
Hi,

Thanks for the suggestion and sorry for the delay in response. I believe I am running gdm. Here is the output from ps -ef | grep gdm:

root 14122 1 0 Apr08 ? 00:00:00 /usr/bin/gdm-binary -nodaemon
root 16055 14122 0 Apr08 ? 00:00:01 /usr/bin/gdm-binary -nodaemon
root 16766 16055 0 Apr09 ? 00:01:06 /usr/X11R6/bin/X :0 -auth /var/gdm/:0.Xauth vt8
xmeadow 25480 25449 0 09:08 pts/1 00:00:00 grep gdm

Please let me know if you think of anything that I might be able to try. Thanks so much.


-NifflerX
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.