I want to delay the start of a service if a file exists (instead of fail the service if the file exist, as with ConditionPathExists=
) but did not find anything in unit documentation
Is it technically possible with systemd ?
How ?
servicessystemd
I want to delay the start of a service if a file exists (instead of fail the service if the file exist, as with ConditionPathExists=
) but did not find anything in unit documentation
Is it technically possible with systemd ?
How ?
Best Answer
using just one unit
Put
TimeoutStartSec=infinity
in the unit file and configureExecStart=
with a script likeThis cannot be done (in a useful way) with
ExecStartPre=
, seeman systemd.service
:using a helper unit
If you want to do this with systemd "alone" then you can create a helper unit
check_and_wait.target
. This one gets the entriesThe main unit gets these entries: