summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/busname.c2
-rw-r--r--src/core/kmod-setup.c7
-rw-r--r--src/core/manager.c2
3 files changed, 5 insertions, 6 deletions
diff --git a/src/core/busname.c b/src/core/busname.c
index 1278c96638..3dc6e87e55 100644
--- a/src/core/busname.c
+++ b/src/core/busname.c
@@ -988,7 +988,7 @@ static bool busname_supported(void) {
static int supported = -1;
if (supported < 0)
- supported = access("/sys/fs/kdbus", F_OK) >= 0;
+ supported = is_kdbus_available();
return supported;
}
diff --git a/src/core/kmod-setup.c b/src/core/kmod-setup.c
index c5117b47ee..132c3e866c 100644
--- a/src/core/kmod-setup.c
+++ b/src/core/kmod-setup.c
@@ -28,6 +28,7 @@
#include "macro.h"
#include "capability.h"
+#include "bus-util.h"
#include "kmod-setup.h"
#ifdef HAVE_KMOD
@@ -44,10 +45,6 @@ static void systemd_kmod_log(
log_internalv(LOG_DEBUG, 0, file, line, fn, format, args);
REENABLE_WARNING;
}
-
-static bool cmdline_check_kdbus(void) {
- return get_proc_cmdline_key("kdbus", NULL) > 0;
-}
#endif
int kmod_setup(void) {
@@ -69,7 +66,7 @@ int kmod_setup(void) {
{ "unix", "/proc/net/unix", true, NULL },
/* IPC is needed before we bring up any other services */
- { "kdbus", "/sys/fs/kdbus", false, cmdline_check_kdbus },
+ { "kdbus", "/sys/fs/kdbus", false, is_kdbus_wanted },
/* netfilter is needed by networkd, nspawn among others, and cannot be autoloaded */
{ "ip_tables", "/proc/net/ip_tables_names", false, NULL },
diff --git a/src/core/manager.c b/src/core/manager.c
index 8c8645b68d..c918f191c9 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -721,6 +721,8 @@ static int manager_setup_kdbus(Manager *m) {
if (m->test_run || m->kdbus_fd >= 0)
return 0;
+ if (!is_kdbus_available())
+ return -ESOCKTNOSUPPORT;
if (m->running_as == SYSTEMD_SYSTEM && detect_container(NULL) <= 0)
bus_kernel_fix_attach_mask();