Comment 8 for bug 1886161

Revision history for this message
Julian Andres Klode (juliank) wrote :

@Robin You should be able to just run `systemctl start apt-daily.service apt-daily-upgrade.service` from the hook. This will start those two services - which run update / upgrade - in the same transaction, and hence ordering will work correctly.

The timer will still run again, so it's not _optimal_, but oh well. An optimal solution would just make the timer "catch up" when the conditions apply. We'll be able to simulate that I guess by moving away from ConditionACPower=true to checking battery state ourself, then exiting with a special error code and retrying on that.

systemd at least was fixed to allow retrying oneshot units a while ago, but we've not had the chance to rework the apt integration to do retries.