Stacked on #132 (4.45.0, head a38f075): this branch merges #132's head and releases 4.46.0 on top of it. Merge it after #132.
Why. Wiring ServicesRestartMixin into napalm-proxmox (NetOrk/netork#2750, NAPALM/napalm-proxmox#77) makes a Proxmox VE node the first host whose /proc scan sees LXC containers' processes. A container updates itself. After its own apt upgrade, its nginx maps a deleted libssl, and its cgroup, 0::/lxc/<vmid>/ns/system.slice/nginx.service, would make nginx a host service that needs a restart. Docker and Podman were already left out (_container). LXC was not.
What.
_maps also leaves out a process whose cgroup is under /lxc/<name>/ (Proxmox VE, which nests the container's own cgroups under ns; cgroup v1) or /lxc.payload.<name>/ (LXC 4 and later).
/lxc.monitor/<name> still counts: lxc-start runs the host's binary.
The listening sockets' _container is unchanged: a container's sockets live in its own network namespace, which the host's ss does not show.
Docstring, README, and a 4.46.0 "Fixed" entry.
Tests.tests/test_services_restart.py: an LXC container's processes are left out (four cgroup forms), and the monitor counts. Whole suite locally: 1932 passed, 3 skipped. ruff clean.
Version. 4.46.0, the next free one after #132's 4.45.0. I re-checked the tags (v4.44.0 is the latest) and the open branches right before the release commit. CI is expected to be red until 4.45.0 is released, as for #132's dependants.
**Stacked on #132** (4.45.0, head a38f075): this branch merges #132's head and releases **4.46.0** on top of it. Merge it after #132.
**Why.** Wiring `ServicesRestartMixin` into napalm-proxmox (NetOrk/netork#2750, NAPALM/napalm-proxmox#77) makes a Proxmox VE node the first host whose `/proc` scan sees LXC containers' processes. A container updates itself. After its own `apt upgrade`, its nginx maps a deleted libssl, and its cgroup, `0::/lxc/<vmid>/ns/system.slice/nginx.service`, would make `nginx` a *host* service that needs a restart. Docker and Podman were already left out (`_container`). LXC was not.
**What.**
- `_maps` also leaves out a process whose cgroup is under `/lxc/<name>/` (Proxmox VE, which nests the container's own cgroups under `ns`; cgroup v1) or `/lxc.payload.<name>/` (LXC 4 and later).
- `/lxc.monitor/<name>` still counts: `lxc-start` runs the host's binary.
- The listening sockets' `_container` is unchanged: a container's sockets live in its own network namespace, which the host's `ss` does not show.
- Docstring, README, and a 4.46.0 "Fixed" entry.
**Tests.** `tests/test_services_restart.py`: an LXC container's processes are left out (four cgroup forms), and the monitor counts. Whole suite locally: 1932 passed, 3 skipped. ruff clean.
**Version.** 4.46.0, the next free one after #132's 4.45.0. I re-checked the tags (v4.44.0 is the latest) and the open branches right before the release commit. CI is expected to be red until 4.45.0 is released, as for #132's dependants.
christianmanivong
changed title from fix(services-restart): an LXC container's processes are left out (NetOrk/netork#2750) to fix(services-restart): an LXC container's processes are left out, 4.46.0 (NetOrk/netork#2750)2026-11-26 18:27:36 +00:00
christianmanivong
changed target branch from feature/services-need-restart to main2026-11-26 18:27:36 +00:00
ServicesRestartMixin.get_services_need_restart reads, as root and in one
fixed read-only command, which systemd services still run code an update
replaced on disk: needs-restarting -s on the dnf family, else needrestart
in batch list-only mode (-r l and NEEDRESTART_MODE=l, whatever its config
says), else the processes whose /proc/<pid>/maps maps deleted code, each
named by its cgroup's service as the listening sockets are. A refused root
raises instead of reading clean.
On a Proxmox node the /proc scan sees every container's processes: an LXC
container updates itself, and its own systemd's units (lxc/<vmid>/ns/...
.service) would read as the host's services needing a restart. They are
left out like Docker's and Podman's: /lxc/<name>/ (Proxmox VE, cgroup v1)
and /lxc.payload.<name>/ (LXC 4 and later). The monitor, lxc.monitor/<name>,
runs the host's lxc-start and still counts.
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.
Stacked on #132 (4.45.0, head
a38f075): this branch merges #132's head and releases 4.46.0 on top of it. Merge it after #132.Why. Wiring
ServicesRestartMixininto napalm-proxmox (NetOrk/netork#2750, NAPALM/napalm-proxmox#77) makes a Proxmox VE node the first host whose/procscan sees LXC containers' processes. A container updates itself. After its ownapt upgrade, its nginx maps a deleted libssl, and its cgroup,0::/lxc/<vmid>/ns/system.slice/nginx.service, would makenginxa host service that needs a restart. Docker and Podman were already left out (_container). LXC was not.What.
_mapsalso leaves out a process whose cgroup is under/lxc/<name>/(Proxmox VE, which nests the container's own cgroups underns; cgroup v1) or/lxc.payload.<name>/(LXC 4 and later)./lxc.monitor/<name>still counts:lxc-startruns the host's binary._containeris unchanged: a container's sockets live in its own network namespace, which the host'sssdoes not show.Tests.
tests/test_services_restart.py: an LXC container's processes are left out (four cgroup forms), and the monitor counts. Whole suite locally: 1932 passed, 3 skipped. ruff clean.Version. 4.46.0, the next free one after #132's 4.45.0. I re-checked the tags (v4.44.0 is the latest) and the open branches right before the release commit. CI is expected to be red until 4.45.0 is released, as for #132's dependants.
fix(services-restart): an LXC container's processes are left out (NetOrk/netork#2750)to fix(services-restart): an LXC container's processes are left out, 4.46.0 (NetOrk/netork#2750)