[ConsoleKit] Race issue with ConsoleKit restart/shutdown

Brian Cameron brian.cameron at oracle.com
Mon Aug 30 15:08:10 PDT 2010


Note that there is the following GDM bug.  However, I think the
problem is really with ConsoleKit/GDM interaction:

   https://bugzilla.gnome.org/show_bug.cgi?id=590965

I spent some time reviewing the code with Ray Strode, and it looks like
gnome-session tells ConsoleKit to do a shutdown or restart.  Then
gnome-session waits for the ConsoleKit "privileges-completed" signal
and logs out the user session.

GDM is never informed that a shutdown/restart request is happening,
so there is a race condition where GDM will try to restart remanaging
the login GUI on the display if the SIGTERM is not received quickly
enough.

In general, it seems a bad idea for GDM to be wasting resources
launching processes while the system is trying to shutdown or reboot.
Ideally shutdown or reboot should be as fast as possible.  Also,
trying to relaunch the login GUI while services are going down can lead
to odd and unpredictable racy behaviors.

It seems it would be better if ConsoleKit informed GDM just before
doing a shutdown or reboot request with a blocking D-Bus call.  GDM
could return after it is in a good state (e.g. not in the middle of
starting a display, say an XDMCP login) and after it has set a flag
that would inhibit launching any further displays.  Then GDM could know
not to relaunch any displays since the system is going down, avoiding
the sorts of problems reported in the above bug.

Though, of course, this is just a suggestion.  There are probably
other ways to solve this problem.  I mostly wanted to highlight that
this GDM bug is related to how ConsoleKit works, and the fix will
probably involve making changes to ConsoleKit.  Not sure if this
bug should be moved to ConsoleKit or if a new ConsoleKit bug should
be added about this issue.

Brian


More information about the ConsoleKit mailing list