From ea9d7b644456b110905bb236a8f68c0a4169ab91 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 11 Mar 2011 03:03:03 +0100 Subject: [PATCH] activation: add /lib/dbus-1/system-services to the search path for services In order to allow D-Bus usage during early boot (where /usr is not accessible) also search for bus activation files in /lib/dbus-1/system-services/. This is only a first step in the right direction, before we really can boot without /usr we'd need to move all current activation files (or possibly replace /usr/dbus-1/system-services to a symlink to /lib/dbus-1/system-services). --- bus/config-parser.c | 4 ++++ dbus/dbus-sysdeps-unix.c | 16 +++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/bus/config-parser.c b/bus/config-parser.c index 8e2cde1..0eb6de5 100644 --- a/bus/config-parser.c +++ b/bus/config-parser.c @@ -3397,6 +3397,10 @@ static const char *test_system_service_dir_matches[] = "/testusr/testshare/dbus-1/system-services", #endif DBUS_DATADIR"/dbus-1/system-services", +#ifdef DBUS_UNIX + "/lib/dbus-1/system-services", +#endif + #ifdef DBUS_WIN NULL, #endif diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index 3594c63..5cd1e10 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -3626,12 +3626,18 @@ _dbus_get_standard_system_servicedirs (DBusList **dirs) } /* - * add configured datadir to defaults - * this may be the same as an xdg dir - * however the config parser should take - * care of duplicates + * Add configured datadir to defaults. This may be the same as one + * of the XDG directories. However, the config parser should take + * care of the duplicates. + * + * Also, append /lib as counterpart of /usr/share on the root + * directory (the root directory does not know /share), in order to + * facilitate early boot system bus activation where /usr might not + * be available. */ - if (!_dbus_string_append (&servicedir_path, DBUS_DATADIR":")) + if (!_dbus_string_append (&servicedir_path, + DBUS_DATADIR":" + "/lib:")) goto oom; if (!_dbus_split_paths_and_append (&servicedir_path, -- 1.7.6