Re: [gdm-list] AlwaysRestartServer




Michael/Yitzhak:

Looking more closely at the code, it looks like the GDM daemon will
try to re-use the XServer over and over again for the same display.
Though it looks like this behavior is only expected for static
displays, not flexi or XDMCP (remote) displays.

Sorry I know I said in my last email that it will restart on logout.
The code is complicated.

If you look at gdm/daemon/slave.c, you will notice that the server
is restarted anywhere that gdm_server_stop() is called.  This is
called in a number of error conditions and also in gdm_slave_quick_exit
(which is also indirectly called by gdm_slave_exit).  There are
a variety of situations that will cause the Xserver to be restarted.
These include:

1) the slave gets a notify signal that certain configuration choices
   have changed that require the greeter to restart.  This should only
   happen if the user edits the config via gdmsetup or is running
   the "UPDATE_CONFIG" gdmflexiserver command after updating the config
   file.  These seem to be written so that they will wait until the
   user has logged out before restarting.  If you notice debug messages
   that the slave is receiving a notify before restarting, then this
   would by why.
2) In a number of error conditions that should never happen (signal
   handlers failing to register, failing to setup pipe, failure to
   fork, etc.).
3) There's a weird case where if user passed auth but getpwname
   failed that gdm_slave_exit is called.  This is probably not something
   that could ever happen.
4) If a TERM signal is received by the slave.  Only root should be able
   to send such a signal.
5) If there were problems starting the Xserver properly.

We have the same problem as Yitzhak where logout/logins are causing X
server crashes in multi-user systems. This problem occurs whether
AlwaysRestartServer is true or false.   The problem and
workaround/solution most likely involves a change to Xorg code and has
nothing to do with GDM, but here is our question for GDM experts:
Is there some fundamentally known instability in the logout/login
process without a full restart (besides memory leaks and other
problems that could happen as the X process runs for weeks at a time
with no chance for cleanup)?

What version of GDM are you using?  Does upgrading to the latest
stable version of GDM (2.8.0.7) make a difference?  Improvements have
been made to GDM to make it smarter for multi-user systems -
especially in version 2.8.0.6.  Though 2.8.0.6 has some nasty bugs
(especially for FreeBSD users) so I'd recommend 2.8.0.7.

Turn on debug (debug/Enable=true in gdm.conf) and check the messages
sent to syslog (/var/log/messages).  Any obvious error messages
appearing?  If not, it might help if you have the time to add some
gdm_debug() messages to the code in places where the gdm_server_stop()
function is called and see if we can track down exactly what is
causing this function to be called.

Also check the Xserver logs.  These are normally saved in /var/log/gdm.
Is the Xserver having problems starting or restarting?  If you see
error messages that look specific to your device (graphics card, etc.)
the problem might be with your hardware or X configuration.  Also
X error messages sometimes go to $HOME/.xsession-errors so checking
there is also useful.

Even with AlwaysRestartServer set to true, GDM sends a SIGHUP to X
(which is required to reset X authentication according to XDM
documentation) and we highly suspect X is also performing some
unnecessary re-initialization of the the video card upon receiving a
SIGHUP.  If X could just deal with setting up authentication for a new
user without touching the video card, everything would probably be
fine.  Our big question for the X developers is: why does X have to
mess with the video card when the X server itself is not restarting? But that is a question for different mailing lists...

It shouldn't send a SIGHUP unless GDM thinks it needs to.  Typically
it thinks it needs to if X doesn't seem to be behaving properly.

Note that if GDM thinks that there is a problem with the Xserver it
automatically restarts it, so the re-initialization of the video
card may just be a by-product of GDM noticing the Xserver is not
working as expected and trying to restart.

The problem is likely either your Xserver isn't configured properly
or GDM has a bug which makes it think the Xserver is broken when
it is not.  Either way, we need to track down the problem to fix it.
As I said above, turning on debug and looking at the output is a
good first step.  This might highlight the problem or identify the
problem as being an Xserver configuration problem.  If not,
adding more gdm_debug statements to the code will probably help
track down the problem.  I'm happy to provide assistance if you
can tell me what you are seeing.

Brian




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]