Public bug reported: Despite configuring unattended-upgrades to run on battery power, the script will only run automatically when on AC power due to a condition of the systemd apt-daily.service
Here is my current Unattended-Upgrades config (apt-config dump Unattended-Upgrade): ``` Unattended-Upgrade ""; Unattended-Upgrade::Allowed-Origins ""; Unattended-Upgrade::Allowed-Origins:: "${distro_id}:${distro_codename}"; Unattended-Upgrade::Allowed-Origins:: "${distro_id}:${distro_codename}-security"; Unattended-Upgrade::Allowed-Origins:: "${distro_id}ESMApps:${distro_codename}-apps-security"; Unattended-Upgrade::Allowed-Origins:: "${distro_id}ESM:${distro_codename}-infra-security"; Unattended-Upgrade::DevRelease "auto"; Unattended-Upgrade::OnlyOnACPower "false"; ``` From testing I found that although unattended-upgrades run on battery power when manually called via the terminal, they do not get run automatically due to a condition check failure in the apt-daily.service ``` ● apt-daily.service - Daily apt download activities Loaded: loaded (/lib/systemd/system/apt-daily.service; static; vendor preset: enabled) Active: inactive (dead) TriggeredBy: ● apt-daily.timer Condition: start condition failed at Thu 2022-02-03 08:08:49 GMT; 8min ago └─ ConditionACPower=true was not met Docs: man:apt(8) Feb 02 10:48:58 ubu20-n-0649f43030 systemd[1]: Condition check resulted in Daily apt download activities being skipped. Feb 03 08:08:49 ubu20-n-0649f43030 systemd[1]: Condition check resulted in Daily apt download activities being skipped. ``` So despite explicitly configuring unattended-upgrades to run on battery power, apt-daily.service seems to have a conflicting condition as well which isn't changed. Perhaps this is a recent change, because as far as I could tell, unattended-upgrades were running correctly with this config until the last few days. Below is some additional information which might be useful: unattended-upgrades - version 2.3ubuntu0.1 apt - version 2.0.6 Ubuntu - version 20.04.3 LTS, Kernel 5.13.0-1012-oem ProblemType: Bug DistroRelease: Ubuntu 20.04 Package: unattended-upgrades 2.3ubuntu0.1 ProcVersionSignature: Ubuntu 5.13.0-1012.16-oem 5.13.1 Uname: Linux 5.13.0-1012-oem x86_64 ApportVersion: 2.20.11-0ubuntu27.21 Architecture: amd64 CasperMD5CheckResult: pass Date: Thu Feb 3 08:42:53 2022 InstallationDate: Installed on 2021-09-02 (153 days ago) InstallationMedia: Ubuntu-Server 20.04.2 LTS "Focal Fossa" - Release amd64 (20210201.2) PackageArchitecture: all ProcEnviron: TERM=xterm-256color PATH=(custom, no user) LANG=en_GB.UTF-8 SHELL=/bin/bash SourcePackage: unattended-upgrades UpgradeStatus: No upgrade log present (probably fresh install) modified.conffile..etc.apt.apt.conf.d.15update-stamp: // This file is managed by Puppet. DO NOT EDIT. APT::Update::Post-Invoke-Success {"touch /var/lib/apt/periodic/update-success-stamp 2>/dev/null || true";}; mtime.conffile..etc.apt.apt.conf.d.10periodic: 2021-09-02T11:49:45.980132 mtime.conffile..etc.apt.apt.conf.d.15update-stamp: 2021-09-02T11:46:39.152655 ** Affects: unattended-upgrades (Ubuntu) Importance: Undecided Status: New ** Tags: amd64 apport-bug focal uec-images -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1959871 Title: Updates/upgrades won't run without AC power, despite explicit config To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/1959871/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs