[Bug 491940] Re: Patch for LTSP clients to properly reboot/shutdown

Alkis Georgopoulos alkisg at gmail.com
Sat Mar 27 19:06:31 UTC 2010


The LTSP user session is running on the server through ssh -X.
The shutdown will need to be executed on the client.
LTSP is using xprops as a mechanism for the server to notify the client to execute something. It is indeed a hack, but that's the "standard" way we do it in LTSP. That's also the way localapps are implemented.

So when the user initiates shutdown, either from the indicator-session applet or from the session dialog (tested and working), an xprop is set. LTSP sessions are remote (ssh) sessions, so ConsoleKit does not consider them active. So a logoff is performed instead of a shutdown/reboot.
After the logoff, the LTSP display manager reads the xprop and sees if it needs to reboot or halt the client.

One better way to resolve this would be to implement appropriate dbus
hooks so that the session bus running on the server "talks" to the
system bus running on the client. Unfortunately, I don't think any LTSP
developer is working on implementing this, and I don't even know if it
can be accomplished.

In previous Ubuntu releases there was a patch in fusa that was hiding
the reboot/shutdown menus for LTSP clients. This isn't used anymore, so
now those menus are there but are just performing "logoff" instead,
confusing the users.

So I'm not aware of any other realistic way to have working
shutdown/reboot menus in LTSP, other than the attached patch.

Kind regards,
Alkis Georgopoulos
Edubuntu/LTSP developer

-- 
Patch for LTSP clients to properly reboot/shutdown
https://bugs.launchpad.net/bugs/491940
You received this bug notification because you are a member of Edubuntu
Bugsquad, which is subscribed to ltsp in ubuntu.

Status in “gnome-session” package in Ubuntu: New
Status in “ltsp” package in Ubuntu: Fix Released

Bug description:
Binary package hint: gnome-session

Please consider the following 4 lines for inclusion to debian/patch/95_dbus_request_shutdown.patch.
Those lines make LTSP clients properly reboot/shutdown.


gboolean
gsm_manager_request_shutdown (GsmManager *manager,
                              GError    **error)
{
        g_debug ("GsmManager: RequestShutdown called");

        g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE);

        if (manager->priv->phase != GSM_MANAGER_PHASE_RUNNING) {
                g_set_error (error,
                             GSM_MANAGER_ERROR,
                             GSM_MANAGER_ERROR_NOT_IN_RUNNING,
                             "RequestShutdown interface is only available during the Running phase");
                return FALSE;
        }

+       if (g_getenv ("LTSP_CLIENT"))
+               g_spawn_command_line_async("xprop -root -f LDM_LOGOUT_ACTION 8s -set LDM_LOGOUT_ACTION HALT", error);

        request_shutdown (manager);

        return TRUE;
}

gboolean
gsm_manager_request_reboot (GsmManager *manager,
                            GError    **error)
{
        g_debug ("GsmManager: RequestReboot called");

        g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE);

        if (manager->priv->phase != GSM_MANAGER_PHASE_RUNNING) {
                g_set_error (error,
                             GSM_MANAGER_ERROR,
                             GSM_MANAGER_ERROR_NOT_IN_RUNNING,
                             "RequestReboot interface is only available during the Running phase");
                return FALSE;
        }

+        if (g_getenv ("LTSP_CLIENT"))
+               g_spawn_command_line_async("xprop -root -f LDM_LOGOUT_ACTION 8s -set LDM_LOGOUT_ACTION REBOOT", error);

        request_reboot (manager);

        return TRUE;
}






More information about the edubuntu-devel mailing list