[systemd-devel] run only a single service at a time

Olaf Hering olaf at aepfle.de
Thu Oct 28 13:04:26 UTC 2021


There is A.timer and its A.service, and B.timer and B.service.
Both A and B do not know about each other per default.
Both timers fire in their own cadence.
Both services have their unpredictable time until they finish.
So it may happen that A.service is started while B.service is still active.

But, unfortunately both services may touch the same files while they run.

Does systemd have a way to serialize execution of such units, so that starting of A.service is delayed until B.service is done, and via versa?

Before=/After= may not apply, at least the docs say nothing about timer driven units.


I might be able to add some locking to A.service and B.service with some creative ExecStartPre/Post= in A.service.d/lock.conf ...


Olaf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: Digitale Signatur von OpenPGP
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20211028/a97d0899/attachment.sig>


More information about the systemd-devel mailing list