From 76c86c34d664084acbe10edb7fafd4fbe9849ddb Mon Sep 17 00:00:00 2001 From: dualfroz Date: Sat, 17 Oct 2026 03:22:03 +0200 Subject: [PATCH] Only use the user unit for pane scope dependencies Pane scopes are created in the user manager, but when the server is not in a user unit, for example when it was started from a login session's session-N.scope, sd_pid_get_unit() returned that system unit and it was set as Before and PartOf of the pane scope. The user manager cannot see system units, so this only leaves a reference to a missing unit. Set the dependencies only when sd_pid_get_user_unit() finds a unit. GitHub issue 5741. --- compat/systemd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compat/systemd.c b/compat/systemd.c index 4d62f57..67049bf 100644 --- a/compat/systemd.c +++ b/compat/systemd.c @@ -234,8 +234,7 @@ systemd_new_scope_message(sd_bus *bus, int oom_policy, sd_bus_message **mp, * as dependent on it. Use "Before" to make sure systemd will not try to * kill them first. */ - if (sd_pid_get_user_unit(parent_pid, &unit) == 0 || - sd_pid_get_unit(parent_pid, &unit) == 0) { + if (sd_pid_get_user_unit(parent_pid, &unit) == 0) { r = sd_bus_message_append(*mp, "(sv)", "Before", "as", 1, unit); if (r >= 0) {