feat(services-restart): the services that still run replaced code (NetOrk/netork#2700)

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.
This commit is contained in:
christianmanivong committed 2026-11-26 17:39:04 +01:00
1 parent 818016b717
commit 9c889f3715
7 files changed
+558

No files matched your search

+15
View File
@@ -7,6 +7,21 @@ recorded here; their history is the git log.
## [Unreleased]
### Added
- `ServicesRestartMixin.get_services_need_restart()`: the systemd services that still run
code an update replaced on disk, so they keep the old library until they restart
(NetOrk/netork#2700). One fixed, read-only command as root: `needs-restarting -s` (the dnf
family), else `needrestart -b -r l` (Debian, Ubuntu; list only, by option and by
`NEEDRESTART_MODE=l`, whatever `needrestart.conf` says), else a scan of
`/proc/<pid>/maps` for executable mappings of deleted files under `/usr`, `/lib*`, `/bin`,
`/sbin` or `/opt`, each process mapped to its service through `/proc/<pid>/cgroup` as the
listening sockets do. A user's own systemd counts as `user@<uid>`, a container's process is
left out, and a process in no service is listed under `processes`. A refused root gives
no report and raises, never a clean reading. A driver supplies
`_run_services_restart_command(command)`.
- `parse_services_restart`, `SERVICES_RESTART_COMMAND`, `DELETED_CODE_PATTERN`, and the
`ServicesRestartDict` and `RestartProcessDict` shapes.
## [4.43.0] - 2026-11-26
### Added