Bug 69877 - dbus-launch will refuse start a dbus-daemon though the previous started was terminated
Summary: dbus-launch will refuse start a dbus-daemon though the previous started was t...
Status: RESOLVED MOVED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: 1.5
Hardware: All All
: medium normal
Assignee: D-Bus Maintainers
QA Contact: D-Bus Maintainers
URL:
Whiteboard:
Keywords:
: 8294 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-09-27 10:27 UTC by Chengwei Yang
Modified: 2018-10-12 21:16 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Chengwei Yang 2013-09-27 10:27:56 UTC
dbus-launch which used to start a dbus-daemon mainly used in autolaunch:, in this situation, dbus-launch will save related infomations into X window system, for example, the bus daemon address. And will decide whether a dbus-daemon is already running according to if an address can get from X window system.

So here comes the problem: if the previously started dbus-daemon was terminated but the dbus-launch is still running, then the next connection request will always fail because dbus-launch refused to start a dbus-daemon.

This behaviour somehow like #bug25841, I'm not quite sure.
Comment 1 Simon McVittie 2013-09-27 11:30:28 UTC
I think the solution is probably to have dbus-launch connect to its own dbus-daemon (without turning off exit-on-disconnect), so that it will automatically exit if the dbus-daemon goes away.

That would require dbus-launch to link to either libdbus-1 (shared library) or libdbus-internal (murky static library), preferably the former, but I think that'd be fine.
Comment 2 Simon McVittie 2013-09-27 11:34:42 UTC
If people like dbus-launch, review/testing of the new --exit-with-x11 option on Bug #39197 would also be useful. It addresses the dbus-launch misfeature that "--exit-with-session" tries to work in a non-X11 environment, and tries to poll a terminal on its stdin to detect the end of a tty session (even though it's not clear whether that actually works).

One day, I would like dbus-launch to be an X11-specific historical curiosity that nobody actually uses any more - it shouldn't be used in Wayland, for instance.
Comment 3 Chengwei Yang 2013-11-20 13:08:14 UTC
(In reply to comment #1)
> I think the solution is probably to have dbus-launch connect to its own
> dbus-daemon (without turning off exit-on-disconnect), so that it will
> automatically exit if the dbus-daemon goes away.

Just investigated this solution, seems it doesn't work. exit-on-disconnect means the program will call _exit() after handled disconnected signal.

However, if dbus-daemon was killed, it didn't send disconnected signal before exit.

> 
> That would require dbus-launch to link to either libdbus-1 (shared library)
> or libdbus-internal (murky static library), preferably the former, but I
> think that'd be fine.
Comment 4 Simon McVittie 2013-11-20 13:25:33 UTC
(In reply to comment #3)
> However, if dbus-daemon was killed, it didn't send disconnected signal
> before exit.

Really? I thought the Disconnected signal was synthesized client-side by libdbus when the kernel notifies it that the socket has been closed?

After all, clients that send invalid UTF-8 normally get an unceremonious close() from the dbus-daemon, and then _exit() when that happens (indeed, plenty of people, including me, have complained about that behaviour).
Comment 5 Chengwei Yang 2013-12-10 13:47:40 UTC
*** Bug 8294 has been marked as a duplicate of this bug. ***
Comment 6 GitLab Migration User 2018-10-12 21:16:59 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/dbus/dbus/issues/90.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.