<listitem><para>After the service process has terminated, keep the service around until it is explicitly
stopped. This is useful to collect runtime information about the service after it finished running. Also see
<varname>RemainAfterExit=</varname> in
- <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
+ <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>. This
+ option may not be combined with <option>--wait</option>, <option>--scope</option>, <option>--pty</option>,
+ <option>--pty-late</option>, or <option>--pipe</option>.
</para>
<xi:include href="version-info.xml" xpointer="v207"/>
completed). On exit, terse information about the unit's runtime is shown, including total runtime (as well as
CPU, memory, IO, and IP accounting data, if the corresponding cgroup accounting settings are enabled)
and the exit code and status of the main process. This output may be suppressed with <option>--quiet</option>.
- This option may not be combined with <option>--no-block</option>, <option>--scope</option> or the various
- path, socket, or timer options.</para>
+ This option may not be combined with <option>--no-block</option>,
+ <option>--remain-after-exit</option>, <option>--scope</option> or the various path, socket, or timer
+ options.</para>
<xi:include href="version-info.xml" xpointer="v232"/></listitem>
</varlistentry>
if (arg_no_block)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"--pty/--pty-late/--pipe is not compatible with --no-block.");
+
+ if (arg_remain_after_exit)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+ "--pty/--pty-late/--pipe is not compatible with --remain-after-exit.");
}
if (arg_stdio == ARG_STDIO_PTY && arg_pty_late && streq_ptr(arg_service_type, "oneshot"))
if (arg_scope)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"--wait may not be combined with --scope.");
+
+ if (arg_remain_after_exit)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+ "--wait may not be combined with --remain-after-exit.");
}
if (arg_scope && arg_root_directory)
grep -q "^Type=oneshot" "/run/systemd/transient/$UNIT.service"
systemctl stop "$UNIT"
(! systemctl cat "$UNIT")
+(! systemd-run --wait --remain-after-exit true)
+(! systemd-run --pipe --remain-after-exit true)
: "Transient service (user daemon)"
systemd-run --wait --pipe --user --machine=testuser@ \