[Sugar-devel] Running an activity through ssh
Sascha Silbe
silbe at activitycentral.com
Fri Apr 13 14:23:44 EDT 2012
Excerpts from Manuel Kaufmann's message of 2012-04-13 18:07:51 +0200:
> I'm trying to run an Activity over "ssh -C -X" to my XO.
[...]
> Is there a way to do this?
Sugar and the Gnome platform it builds on generally assume there's a
single, local, graphical session. In particular, the D-Bus session bus
is used for IPC (e.g. data store access, Collaboration, even some
interactions between Activities and "the Shell").
If you're feeling adventurous, you can try using the D-Bus session bus
of the Sugar session, but still running the Activity a) outside the
Sugar session (POSIX session id, some environment variables etc. are
different) and b) on a different display (the one forwarded by ssh). I'm
using the method below to access the data store remotely, but never
tried anything more advanced (like running an Activity).
Put the following inside your X session script:
{{{
echo "DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS" > ~/.sugar/dbus-session-bus-address.sh
}}}
The X session script is ~/.xsession on most distros, but OLPC OS uses a
custom display manager called olpc-dm and IIRC there was something
peculiar about the way it treated ~/.xsession, which may (or may not)
prevent the above from working as expected. You may have better luck
sticking it into ~/.sugar/debug. That file isn't meant for this kind of
usage, but it currently works.
Then from your SSH session source the file created above and export
DBUS_SESSION_BUS_ADDRESS so applications can connect to the D-Bus
session bus:
{{{
. ~/.sugar/dbus-session-bus-address.sh
export DBUS_SESSION_BUS_ADDRESS
}}}
I used to have a ~/.ssh/rc that read
~/.sugar/dbus-session-bus-address.sh so I'd always use the D-Bus session
bus of the Sugar session. Unfortunately, for some reason, this broke
some time ago: environment variables set in ~/.ssh/rc don't get
propagated to the user shell anymore. But if you really wanted to
automate it, you could update ~/.ssh/environment from within ~/.xsession
or ~/.sugar/debug.
Sascha
--
http://sascha.silbe.org/
http://www.infra-silbe.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20120413/fb85efc8/attachment-0001.pgp>
More information about the Sugar-devel
mailing list