On Mo, 2010-11-22 at 18:11 +0100, Josselin Mouette wrote:
> Le lundi 22 novembre 2010 à 18:01 +0100, Julian Andres Klode a écrit :
> > > It should, instead, use the gnome-session D-Bus interface when
> > > available, so that applications are closed cleanly.
> > 
> > It runs org.gnome.SessionManager.RequestReboot() first, if that fails it
> > uses HAL. If I recall correctly, RequestReboot() is an Ubuntu-specific
> > extension and not available in Debian, and something I wanted to work
> > around.
> 
> I think it should request org.gnome.SessionManager.Shutdown() if the
> first attempt fails.
> 
> And if this one fails it should use ConsoleKit instead of HAL.
> 
> Would this be suitable?
Attaching the possible fix, just in order to not forget it.

=== modified file 'src/reboot.c'
--- src/reboot.c        2010-08-02 12:50:29 +0000
+++ src/reboot.c        2010-11-22 18:06:57 +0000
@@ -91,14 +91,14 @@ hal_action_reboot()
    }
 
   proxy = dbus_g_proxy_new_for_name (connection,
-                                     "org.freedesktop.Hal",
-                                     "/org/freedesktop/Hal/devices/computer",
-                                     
"org.freedesktop.Hal.Device.SystemPowerManagement");
+                                     "org.freedesktop.ConsoleKit.Manager",
+                                     "/org/freedesktop/ConsoleKit/Manager",
+                                     "org.freedesktop.ConsoleKit.Manager");
   if (proxy == NULL)
      return FALSE;
 
   error = NULL;
-  if (!dbus_g_proxy_call (proxy, "Reboot", &error,
+  if (!dbus_g_proxy_call (proxy, "Restart", &error,
                           G_TYPE_INVALID, G_TYPE_INVALID)) {
      g_error_free (error);
      return FALSE;

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.





-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to