[systemd-devel] Ordering (apt) timer services to not run at the same time
Dan Nicholson
nicholson at endlessm.com
Sat Apr 29 13:59:57 UTC 2017
On Apr 27, 2017 4:31 PM, "Julian Andres Klode" <jak at debian.org> wrote:
Hi systemd folks,
(service and timer files being discussed at the bottom)
we are currently reworking the way automatic updates and upgrades work
on Ubuntu and Debian systems. We basically have two persistent timers
with associated services:
1. apt-daily - Downloads new lists and packages
2. apt-daily-upgrade - Performs upgrades
The first job should run spread out through the day (we run it twice
due to some other reasons), the latter in the morning between 6 and 7,
and at boot, daily-upgrade should be resumed after daily (so we added
After ordering relations to apt-daily-upgrade timer and service).
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).
It seems to me that this could be easily around by adding
Wants=apt-daily.service to the upgrade unit. That will guarantee that
systemd puts the update job in the queue before the upgrade job. I think
this is what you want, anyways. You want to make sure that you have the
latest lists before starting the upgrade. If you get the timers lined up,
then maybe you won't even get any additional update jobs run.
Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20170429/29b16347/attachment.html>
More information about the systemd-devel
mailing list