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

Leon Fauster leonfauster at googlemail.com
Fri Oct 29 10:52:06 UTC 2021


Am 29.10.21 um 07:47 schrieb Andrei Borzenkov:
> On 28.10.2021 16:04, Olaf Hering wrote:
>> 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?
>>
> 
> Not that I am aware of. Similar questions (or requests) came up in the past.



Maybe ExecCondition= can be used with a customscript (or ExecStartPre=)?

$ man systemd.service


--
Leon


More information about the systemd-devel mailing list