[sugar] python activities startup

Tomeu Vizoso tomeu
Fri Feb 8 07:41:07 EST 2008

On Thu, 2008-02-07 at 16:46 +0000, Simon McVittie wrote:
> A better solution would be for Rainbow to avoid SessionBus() entirely,
> and instead use an instance of the superclass, dbus.bus.BusConnection. This
> does not have the weird caching behaviour at all (one call to the
> constructor = one instance = one D-Bus connection). The code that gets run
> after forking is still free to use the shared SessionBus.

Rainbow is not using the session bus at all, just the system one.

But when the child tries to instantiate a SessionBus object, I get this stack trace:

/usr/lib/python2.5/site-packages/sugar/presence/presenceservice.py in __init__(self=<PresenceService object at 0x86afbbc (sugar+presence+presenceservice+PresenceService at 0x86f1370)>, allow_offline_iface=False)
     74         # Get a connection to the session bus
---> 75         self._bus = dbus.SessionBus()
        self._bus = undefined
        global dbus.SessionBus = <class 'dbus._dbus.SessionBus'>
     76         self._bus.add_signal_receiver(self._name_owner_changed_cb,
     77                                     signal_name="NameOwnerChanged",

/usr/lib/python2.5/site-packages/dbus/_dbus.py in __new__(cls=<class 'dbus._dbus.SessionBus'>, private=False, mainloop=None)
    211         """
    212         return Bus.__new__(cls, Bus.TYPE_SESSION, private=private,
--> 213                            mainloop=mainloop)
        mainloop = None
    215 class StarterBus(Bus):

/usr/lib/python2.5/site-packages/dbus/_dbus.py in __new__(cls=<class 'dbus._dbus.SessionBus'>, bus_type=0, private=False, mainloop=None)
    100             raise ValueError('invalid bus_type %s' % bus_type)
--> 102         bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
        bus = undefined
        global BusConnection.__new__ = <function __new__ at 0x822733c>
        subclass = <class 'dbus._dbus.SessionBus'>
        bus_type = 0
        mainloop = None
    104         bus._bus_type = bus_type

/usr/lib/python2.5/site-packages/dbus/bus.py in __new__(cls=<class 'dbus._dbus.SessionBus'>, address_or_type=0, mainloop=None)
    124     def __new__(cls, address_or_type=TYPE_SESSION, mainloop=None):
--> 125         bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
        bus = undefined
        cls._new_for_bus = <built-in method _new_for_bus of type object at 0x8256f44>
        address_or_type = 0
        mainloop = None
    127         # _bus_names is used by dbus.service.BusName!

<class 'dbus.exceptions.DBusException'>: org.freedesktop.DBus.Error.NoServer: Failed to connect to socket /tmp/dbus-7dk02BRXOZ: Connection refused

This is the value of the DBUS_SESSION_BUS_ADDRESS env var:

unix:path=/tmp/olpc-session-bus is specified
in /etc/dbus-1/session-olpc.conf:

  <!-- Our well-known bus type, don't change this -->


  <standard_session_servicedirs />

Any ideas?



More information about the Sugar-devel mailing list