From 7eed8858d7cbdc10ac048552164ad8d3510df846 Mon Sep 17 00:00:00 2001 From: Ronan Pigott Date: Mon, 29 Jun 2026 12:14:58 -0700 Subject: [PATCH] run: do not munge user.slice with --slice-inherit When using --slice-inherit, setting arg_slice would inadvertently munge user.slice into the current user slice, usually producing a slice name like user-1000-user.slice. This is treated as a user-UID slice by user-.slice.d/10-defaults.conf, resulting in a strange description: literally "User slice for UID user" (instead of an actual user UID). Keep arg_slice empty when using --slice-inherit so that we actually inherit from the relevant slice instead of a munged version. Fixes: #42601 --- src/run/run.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/run/run.c b/src/run/run.c index 2e37a0a2f6..168cd2f4e6 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -1049,7 +1049,7 @@ static int parse_argv_sudo_mode(int argc, char *argv[]) { strv_free_and_replace(arg_cmdline, l); - if (!arg_slice) { + if (!custom_slice) { arg_slice = strdup(SPECIAL_USER_SLICE); if (!arg_slice) return log_oom();