From d4506301f945006c1619f7455b35653517b57a74 Mon Sep 17 00:00:00 2001 From: Joerg Behrmann Date: Thu, 30 Nov 2023 11:01:16 +0100 Subject: [PATCH] man: document how to properly use a target as the Unit= of a timer --- man/systemd.timer.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/man/systemd.timer.xml b/man/systemd.timer.xml index 59215dc72a1..e5af7c01a49 100644 --- a/man/systemd.timer.xml +++ b/man/systemd.timer.xml @@ -49,9 +49,11 @@ Note that in case the unit to activate is already active at the time the timer elapses it is not restarted, but simply left running. There is no concept of spawning new service instances in this case. Due to this, services - with RemainAfterExit= set (which stay around continuously even after the service's main process - exited) are usually not suitable for activation via repetitive timers, as they will only be activated once, and - then stay around forever. + with RemainAfterExit=yes set (which stay around continuously even after the service's main + process exited) are usually not suitable for activation via repetitive timers, as they will only be activated + once, and then stay around forever. Target units, which by default do not deactivate on their own, can be + activated repeatedly by timers by setting StopWhenUnneeded=yes on them. This will cause a + target unit to be stopped immediately after its activation, if it is not a dependency of another running unit.