From: Rocker Zhang Date: Fri, 15 May 2026 11:27:57 +0000 (+0800) Subject: man: clarify that ExecCondition= skip triggers SuccessAction= X-Git-Tag: v261-rc3~67 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=90e3b4cb2653f8a96512da625eb92bc72607a136;p=thirdparty%2Fsystemd.git man: clarify that ExecCondition= skip triggers SuccessAction= Unit-level Condition…= / Assert…= directives that fail prevent activation entirely, so SuccessAction= / FailureAction= never fire. An ExecCondition= skip in [Service] runs as part of the activation transition itself, so the unit goes active → inactive and SuccessAction= is honored. This asymmetry has tripped users up; document it explicitly in both systemd.service(5) (ExecCondition= section) and systemd.unit(5) (SuccessAction= / FailureAction= section) with cross-references. Fixes: https://github.com/systemd/systemd/issues/42035 Co-developed-by: Claude Opus 4.7 --- diff --git a/man/systemd.service.xml b/man/systemd.service.xml index 0c5f222bb7a..ed0f9476a00 100644 --- a/man/systemd.service.xml +++ b/man/systemd.service.xml @@ -457,6 +457,15 @@ signal, etc.), the unit will be considered failed (and remaining commands will be skipped). Exit code of 0 or those matching SuccessExitStatus= will continue execution to the next commands. + Note that an ExecCondition= skip is not equivalent to a + unit-level Condition…= or Assert…= check failing. Because + ExecCondition= runs as part of the activation transition, a skip causes the unit to + transition from active to inactive, and consequently + SuccessAction= (see + systemd.unit5) will be + honored. By contrast, Condition…= directives in the [Unit] section + prevent activation entirely and therefore do not trigger SuccessAction=. + The same recommendations about not running long-running processes in ExecStartPre= also applies to ExecCondition=. ExecCondition= will also run the commands in ExecStopPost=, as part of stopping the service, in the case of any non-zero or abnormal diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml index 2990e658911..5d2f32dfcef 100644 --- a/man/systemd.unit.xml +++ b/man/systemd.unit.xml @@ -1115,6 +1115,16 @@ allowed. In user mode, only , , and are allowed. Both options default to . + These actions are tied to the unit's state transitions and fire only when the unit actually + transitions out of an active or activating state. As a + consequence, Condition…= and Assert…= directives that fail do + not trigger SuccessAction= or + FailureAction=: they prevent activation in the first place, so no state transition + occurs. By contrast, the ExecCondition= directive in + systemd.service5 + runs as part of activation, so an ExecCondition= skip will + trigger SuccessAction=. + If is set, no action will be triggered. causes a reboot following the normal shutdown procedure (i.e. equivalent to systemctl reboot). causes a forced reboot which will terminate all