From: Shihao Ren Date: Tue, 30 Jun 2026 12:30:50 +0000 (+0800) Subject: run: refuse --no-block when combined with --scope X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=48dc1bbd09614b44d34b6528cfad2bbefeace739;p=thirdparty%2Fsystemd.git run: refuse --no-block when combined with --scope In the systemd-run --scope mode, --no-block has no actual effect and will be silently ignored. Therefore, this combination is explicitly rejected to reduce confusion for users when using it. Fixes: #42806 --- diff --git a/man/systemd-run.xml b/man/systemd-run.xml index e66672f7168..386702ac401 100644 --- a/man/systemd-run.xml +++ b/man/systemd-run.xml @@ -514,7 +514,7 @@ Do not synchronously wait for the unit start operation to finish. If this option is not specified, the start request for the transient unit will be verified, enqueued and systemd-run will wait until the unit's start-up is completed. By passing this argument, it is only verified and enqueued. This - option may not be combined with . + option may not be combined with or . diff --git a/src/run/run.c b/src/run/run.c index 168cd2f4e67..785ac9e6687 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -694,6 +694,10 @@ static int parse_argv(int argc, char *argv[]) { return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "--remain-after-exit and --service-type= are not supported in --scope mode."); + if (arg_scope && arg_no_block) + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), + "--no-block is not supported in --scope mode."); + if (arg_stdio != ARG_STDIO_NONE) { if (with_trigger || arg_scope) return log_error_errno(SYNTHETIC_ERRNO(EINVAL),