When testing Sugar (OLPC) on Debian, I find that suger-clipboard (a dbus activated service) is not shutdown when I ^C the dbus.
I'm not a dbus expert but it looks like (http://dbus.freedesktop.org/doc/diagram.png) you keep a TCP connection between the dbus and all dbus connected processes. So you should be able to detect a SIGPIPE or read error on the socket and shutdown.
Relate suspicious evidence is that activated processes start in a detach/daemonized state (parent=init instead of parent=dbus). This doesn't make any sense since you _want_ a parent/child relationship between the dbus and activated services, no? So you are going to the extra trouble of daemonizing when it seems counterproductive.
John (J5) Palmieri wrote:
> If you have a D-Bus connection open and the exit on disconnect flag is
> enabled (default) then it should be killed when the connection
> disconnects (i.e. the bus goes away).
We detach from the bus on purpose. You can start a service up without using D-Bus activation and it should behave exactly the same as if it were activated by the bus. Some services wish to survive D-Bus restarts (in which case they set exit_on_disconnect to false). I'll take a look at the clipboard service to see what is going on. I suspect it is something in the python bindings.
I don't think there's a dbus bug here. libdbus does default to exiting on disconnect from the bus. The default may or may not be right for Sugar; it's right for pretty much every normal desktop-type app, but Sugar has its own setup. In any case, libdbus lets the app choose whether to exit on disconnect or not, so if there's a bug here, it's in the app.
Thanks for the hint, j5. conn-methods.c:277 "The default is for this feature to be disabled for Connections and enabled for Buses"
So we probably just need to enable it. I will follow up.
Can dbus-launch --exit-with-session watch for SIGINT as well as SIGTERM? It seems counterintuitive that these two signals cause very different behavior.
Can we have some action on this bug? It's not like I am asking for the moon.
(In reply to comment #5)
> Can dbus-launch --exit-with-session watch for SIGINT as well as SIGTERM?
Seems to be Bug #23977.
*** This bug has been marked as a duplicate of bug 23977 ***