dbus/tools
Simon McVittie 363919696a dbus-launch: If no X11, look for existing bus before failing
What we are aiming for here is that `dbus-launch --autolaunch` will
exit with an error if it would have been unable to advertise the bus
in a way that will be picked up by other instances of itself, so that
we don't get a proliferation of autolaunched dbus-launch instances,
each with its own dbus-daemon, and none of them talking to the others.

However, we don't need to do that *immediately*: we can try to look for
an existing instance first. If we find one, then we can assume that
it's suitable for use, even if X11 autolaunching was disabled at
compile-time or if connecting to the X server failed at runtime. We
only need to bail out if we get to the point where we are ready to start
forking child processes.

This lets systemd users run `dbus-launch --autolaunch` to find a
systemd-managed dbus-daemon, even if X11 autolaunching is disabled.
When combined with the previous commit, it also lets macOS users run
`dbus-launch --autolaunch` to find a launchd-managed dbus-daemon.

Resolves: dbus/dbus#385
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-03-29 14:38:43 +00:00
..
docker/windows docker/windows: fix bad path from MR !218 2022-01-27 23:07:18 +04:00
.gitignore .gitignore: Ignore many more generated files 2018-12-14 13:28:50 +00:00
ci-build.sh On CI add build support for openSUSE distributions 2022-03-29 12:47:59 +00:00
ci-install.sh On CI add build support for openSUSE distributions 2022-03-29 12:47:59 +00:00
cmake-format tools/cmake-format: fix sed warning Expression #1, char 25: unknown option for »s« in --all mode 2021-10-25 15:56:09 +02:00
CMakeLists.txt tools/dbus-run-session: fix race between manual and automatically started dbus-daemon on Windows 2021-11-23 08:38:14 +01:00
dbus-cleanup-sockets.c dbus-cleanup-sockets: Mark functions noreturn as suggested by clang 2018-08-30 17:39:21 +01:00
dbus-echo.c Add missing function attributes suggested by clang (but not by gcc) 2016-10-13 22:44:13 +01:00
dbus-launch-win.c Be more const-correct 2016-10-13 17:20:28 +01:00
dbus-launch-x11.c dbus-launch: Replace slashes in DISPLAY if present 2020-11-06 17:17:09 +00:00
dbus-launch.c dbus-launch: If no X11, look for existing bus before failing 2022-03-29 14:38:43 +00:00
dbus-launch.h Add missing function attributes suggested by clang (but not by gcc) 2016-10-13 22:44:13 +01:00
dbus-monitor.c Normalize C source files to end with exactly one newline 2020-06-10 10:47:31 +00:00
dbus-print-message.c Normalize C source files to end with exactly one newline 2020-06-10 10:47:31 +00:00
dbus-print-message.h dbus-monitor: Add timestamp to --monitor mode. 2015-02-24 13:29:45 +00:00
dbus-run-session.c _dbus_spawn_program(): Add additional parameter to return error 2021-11-29 13:07:04 +01:00
dbus-send.c dbus-send: Validate interface, member names before use 2021-06-21 12:04:05 +01:00
dbus-spam.c tools: Improve argument validation in dbus-spam 2017-02-13 14:52:19 +00:00
dbus-update-activation-environment.c Clean up how we arrange for environ to be declared 2016-10-13 17:20:34 +01:00
dbus-uuidgen.c Rename dbus_internal_do_not_use_get_uuid to _dbus_get_uuid 2018-08-02 15:26:24 +01:00
GetAllMatchRules.py GetAllMatchRules: provide an example how it could be used 2014-10-06 12:10:51 +01:00
Makefile.am tools/dbus-run-session: fix race between manual and automatically started dbus-daemon on Windows 2021-11-23 08:38:14 +01:00
run-with-tmp-session-bus.sh Use separate bus configuration files for executing test cases with a temporary session bus 2018-10-18 20:06:43 +02:00
strtoll.c Normalize C source files to end with exactly one newline 2020-06-10 10:47:31 +00:00
strtoull.c Include config.h as the first thing in every .c file 2013-02-22 13:08:27 +00:00
test-tool.c dbus-test-tool: add black-hole mode 2014-10-14 13:53:59 +01:00
test-tool.h dbus-test-tool: add black-hole mode 2014-10-14 13:53:59 +01:00
tool-common.c tools/dbus-run-session: fix race between manual and automatically started dbus-daemon on Windows 2021-11-23 08:38:14 +01:00
tool-common.h tools/dbus-run-session: fix race between manual and automatically started dbus-daemon on Windows 2021-11-23 08:38:14 +01:00
user-path.reg.in CI: Add running test cases for cross builds 2020-05-29 16:43:45 +02:00
Win32.Manifest Add Windows manifest to dbus-update-activation-environment.exe 2017-09-27 22:05:13 +02:00