From 31d74c66e245fdfdcdbb28c4179cc62a5434570f Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 12 Sep 2020 15:52:02 +0200 Subject: [PATCH 1/2] core: don't warn if BusName= is used for non-Type=dbus services It's useful for more than just Type=dbus now, given #16976. Hence, let's drop the warning. --- src/core/service.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/core/service.c b/src/core/service.c index 03493fd04b..ad6c2d4dde 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -589,9 +589,6 @@ static int service_verify(Service *s) { return -ENOEXEC; } - if (s->bus_name && s->type != SERVICE_DBUS) - log_unit_warning(UNIT(s), "Service has a D-Bus service name specified, but is not of type dbus. Ignoring."); - if (s->exec_context.pam_name && !IN_SET(s->kill_context.kill_mode, KILL_CONTROL_GROUP, KILL_MIXED)) { log_unit_error(UNIT(s), "Service has PAM enabled. Kill mode must be set to 'control-group' or 'mixed'. Refusing."); return -ENOEXEC; From a7f49f0b7c71dfac47ac5d9cae062bcbdb73117b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 12 Sep 2020 15:53:24 +0200 Subject: [PATCH 2/2] service: add implicit dbus deps only for Type=dbus units We want to be able to use BusName= in services that run during early boot already, and thus don't synthesize deps on dbus there. Instead add them when Type=dbus is set, because in that case we actually really need D-Bus support. Fixes: #17037 --- src/core/service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/service.c b/src/core/service.c index ad6c2d4dde..62218293f9 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -684,7 +684,7 @@ static int service_setup_bus_name(Service *s) { assert(s); - if (!s->bus_name) + if (s->type != SERVICE_DBUS) return 0; r = unit_add_dependency_by_name(UNIT(s), UNIT_REQUIRES, SPECIAL_DBUS_SOCKET, true, UNIT_DEPENDENCY_FILE);