[systemd-devel] Ordering (apt) timer services to not run at the same time

Michal Sekletar msekleta at redhat.com
Fri Apr 28 06:46:45 UTC 2017


On Thu, Apr 27, 2017 at 11:30 PM, Julian Andres Klode <jak at debian.org> wrote:

> Now, we seem to be missing one bit: If daily-upgrade is already
> running, and daily is about to start, daily should wait for
> daily-upgrade to finish. I had hoped that maybe that works
> automatically given that there is some ordering relation between the
> two, but that did not work out. I tried adding Conflicts, but systemd
> then said "loop to fast" and became unresponsive (not sure if caused
> by this, but maybe).

After/Before dependencies ensure ordering between respective jobs in a
transaction (actually between both jobs in a single transaction and
between jobs that are already in run queue). However, ordering doesn't
affect jobs that we've already dispatched, since they are already
running we can't do much about them.

AFAICT, you are asking for the opposite of Requisite dependency and we
don't have such dependency.

"Looping too fast" message usually indicates bug of some kind. Please
try to reproduce with latest upstream and file an issue in case this
is still reproducible.

>
> Is there a way to make this work in systemd, or do we need to add
> locking to the script invocation (like
> s#ExecStart=#ExecStart=/usr/bin/flock /path/to/lock#)?

Indeed, seems like lockfile + condition in other unit is the simplest way out.

Michal


More information about the systemd-devel mailing list