Comment 3 for bug 391559

Revision history for this message
Colin Watson (cjwatson) wrote : Re: [Bug 391559] Re: RequestReboot() causes dialog to appear briefly

On Wed, Jun 24, 2009 at 12:18:03PM -0000, Chris Coulson wrote:
> Is this the inhibit dialog which appears? RequestReboot() is non-interactive
> in the sense that it bypasses the session dialog, but still triggers all the
> usual session teardown stuff (asking clients if it is ok to shutdown, to
> give them a chance to block etc), so you may still see an inhibit dialog,
> and some clients may ask if you want to save work.

I can't quite see because it disappears too quickly (I don't think it
finishes rendering), but I would be surprised if there are any active
inhibiting clients - I saw this on a clean live CD desktop.

> This is the intended behavior, but I suppose the DBus API could be
> expanded to provide a truly non-interactive option which just stops
> the session. However, that can already be achieved by calling Stop()
> on consolekit.

I do actually need to trigger a reboot, though (just 'reboot' isn't
enough because that doesn't tend to shut down very cleanly). Stop()
won't do that, will it?

> It might be worth working out which client inhibits though, so that can be
> fixed instead.

GetInhibitors() appears to return an empty array, unless I'm doing
something wrong.

  import dbus
  s = dbus.Bus.get_session()
  m = s.get_object('org.gnome.SessionManager', '/org/gnome/SessionManager')
  m.GetInhibitors()

Unless the installer is inhibiting the session manager itself, of
course; but it doesn't do so explicitly as far as I know.