An unattended upgrade cut off while it built an initrd left a kernel package half-configured on an Ubuntu host. For three months apt refused every upgrade, while apt.systemd.daily exited quietly and the timers reported success.
HOST_STATUS_COMMAND now also reads, without root:
dpkg's state, the way apt checks it: numbered files left in /var/lib/dpkg/updates, or a package half-installed, unpacked, half-configured, waiting for triggers or flagged for reinstallation (dpkg-query -W -f='${db:Status-Abbrev} ${Package}', filtered on the host). While dpkg, apt, aptitude or unattended-upgrade runs, packages are halfway on purpose, so the answer is then None.
When the host's own automatic updates last succeeded:/var/lib/apt/periodic/upgrade-stamp, which apt.systemd.daily touches only after unattended-upgrade succeeded, and the interval of APT::Periodic::Unattended-Upgrade in apt's units (s, m, h, d; a bare number is days; always is 0). update-success-stamp is not read: every apt-get update touches it, whoever runs it.
HostStatusDict gains package_manager_interrupted, interrupted_packages ([{name, state}]), auto_updates_last_success (Unix time) and auto_updates_interval (seconds), all NotRequired. Version 4.3.0.
Tests
tests/test_host_status.py: the aris fixture (iF linux-image-6.8.0-134-generic), every halfway state, the journal alone, tmp.i ignored, a running package manager, no dpkg; the stamp and every interval unit.
The whole suite: 481 passed; mypy strict clean.
napalm-linux, napalm-proxmox, napalm-bsd, napalm-openmediavault and napalm-opnsense pass against this branch.
The command run on an Ubuntu host parses cleanly (interrupted: False).
Part of NetOrk/netork#738.
An unattended upgrade cut off while it built an initrd left a kernel package half-configured on an Ubuntu host. For three months apt refused every upgrade, while `apt.systemd.daily` exited quietly and the timers reported success.
`HOST_STATUS_COMMAND` now also reads, without root:
- **dpkg's state, the way apt checks it:** numbered files left in `/var/lib/dpkg/updates`, or a package half-installed, unpacked, half-configured, waiting for triggers or flagged for reinstallation (`dpkg-query -W -f='${db:Status-Abbrev} ${Package}'`, filtered on the host). While dpkg, apt, aptitude or unattended-upgrade runs, packages are halfway on purpose, so the answer is then `None`.
- **When the host's own automatic updates last succeeded:** `/var/lib/apt/periodic/upgrade-stamp`, which `apt.systemd.daily` touches only after unattended-upgrade succeeded, and the interval of `APT::Periodic::Unattended-Upgrade` in apt's units (s, m, h, d; a bare number is days; `always` is 0). `update-success-stamp` is not read: every `apt-get update` touches it, whoever runs it.
`HostStatusDict` gains `package_manager_interrupted`, `interrupted_packages` (`[{name, state}]`), `auto_updates_last_success` (Unix time) and `auto_updates_interval` (seconds), all `NotRequired`. Version 4.3.0.
## Tests
- `tests/test_host_status.py`: the aris fixture (`iF linux-image-6.8.0-134-generic`), every halfway state, the journal alone, `tmp.i` ignored, a running package manager, no dpkg; the stamp and every interval unit.
- The whole suite: 481 passed; mypy strict clean.
- napalm-linux, napalm-proxmox, napalm-bsd, napalm-openmediavault and napalm-opnsense pass against this branch.
- The command run on an Ubuntu host parses cleanly (`interrupted: False`).
An unattended upgrade cut off while it built an initrd left a kernel package
half-configured on an Ubuntu host. For three months apt refused every upgrade,
while apt.systemd.daily exited quietly and the timers reported success
(NetOrk/netork#738).
HOST_STATUS_COMMAND now also reads, without root:
- dpkg's state the way apt checks it: numbered files left in
/var/lib/dpkg/updates, or a package half-installed, unpacked,
half-configured, waiting for triggers or flagged for reinstallation.
While dpkg, apt, aptitude or unattended-upgrade runs, packages are
halfway on purpose, so the answer is then None.
- /var/lib/apt/periodic/upgrade-stamp, which apt.systemd.daily touches only
after unattended-upgrade succeeded, and the interval of
APT::Periodic::Unattended-Upgrade in apt's units. update-success-stamp is
not read: every apt-get update touches it, whoever runs it.
HostStatusDict gains package_manager_interrupted, interrupted_packages,
auto_updates_last_success and auto_updates_interval, all NotRequired.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part of NetOrk/netork#738.
An unattended upgrade cut off while it built an initrd left a kernel package half-configured on an Ubuntu host. For three months apt refused every upgrade, while
apt.systemd.dailyexited quietly and the timers reported success.HOST_STATUS_COMMANDnow also reads, without root:/var/lib/dpkg/updates, or a package half-installed, unpacked, half-configured, waiting for triggers or flagged for reinstallation (dpkg-query -W -f='${db:Status-Abbrev} ${Package}', filtered on the host). While dpkg, apt, aptitude or unattended-upgrade runs, packages are halfway on purpose, so the answer is thenNone./var/lib/apt/periodic/upgrade-stamp, whichapt.systemd.dailytouches only after unattended-upgrade succeeded, and the interval ofAPT::Periodic::Unattended-Upgradein apt's units (s, m, h, d; a bare number is days;alwaysis 0).update-success-stampis not read: everyapt-get updatetouches it, whoever runs it.HostStatusDictgainspackage_manager_interrupted,interrupted_packages([{name, state}]),auto_updates_last_success(Unix time) andauto_updates_interval(seconds), allNotRequired. Version 4.3.0.Tests
tests/test_host_status.py: the aris fixture (iF linux-image-6.8.0-134-generic), every halfway state, the journal alone,tmp.iignored, a running package manager, no dpkg; the stamp and every interval unit.interrupted: False).