From: Mike Yuan Date: Sun, 16 Mar 2025 23:21:46 +0000 (+0100) Subject: run: refuse --pty-late for Type=oneshot services X-Git-Tag: v258-rc1~1068^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F36765%2Fhead;p=thirdparty%2Fsystemd.git run: refuse --pty-late for Type=oneshot services Such combination makes no sense, as by the time the start job of the oneshot service finishes the main process has already exited. Addresses https://github.com/systemd/systemd/pull/36691#discussion_r1988116881 --- diff --git a/src/run/run.c b/src/run/run.c index 182925aff0b..523993cffdb 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -775,6 +775,10 @@ static int parse_argv(int argc, char *argv[]) { "--pty/--pty-late/--pipe is not compatible with --no-block."); } + if (arg_stdio == ARG_STDIO_PTY && arg_pty_late && streq_ptr(arg_service_type, "oneshot")) + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), + "--pty-late is not compatible with --service-type=oneshot."); + if (arg_scope && with_trigger) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Path, socket or timer options are not supported in --scope mode.");