feat(services-restart): which services still run replaced code, as root (NetOrk/netork#2700) #86

Merged
christianmanivong merged 3 commits from feature/services-need-restart into main 2026-11-26 18:59:42 +00:00
Owner

LinuxProcessReadingsMixin now carries napalm-device-types' ServicesRestartMixin (4.44.0, NAPALM/napalm-device-types branch feature/services-need-restart). Its _run_services_restart_command goes through _run_privileged, the same path the listening sockets take: root directly, sudo -S with a password, sudo -n sh -c without one. The command reads no stdin. Unlike the listening sockets there is no unprivileged retry, because a reading of the login user's own processes would look clean.

OpenMediaVault and QNAP get it through LinuxDriver.

Tests: TestGetServicesNeedRestart in test_linux.py covers the shared command, the whole script running under sudo -n, and a refused sudo raising after one try. The new caller is also added to test_sudo_without_password's list of privileged callers. The full suite passes (467 passed).

Requires napalm-device-types >= 4.44.0. Release 0.19.0 (separate commit). Part of NetOrk/netork#2700 (option A).

`LinuxProcessReadingsMixin` now carries napalm-device-types' `ServicesRestartMixin` (4.44.0, NAPALM/napalm-device-types branch `feature/services-need-restart`). Its `_run_services_restart_command` goes through `_run_privileged`, the same path the listening sockets take: root directly, `sudo -S` with a password, `sudo -n sh -c` without one. The command reads no stdin. Unlike the listening sockets there is no unprivileged retry, because a reading of the login user's own processes would look clean. OpenMediaVault and QNAP get it through `LinuxDriver`. **Tests:** `TestGetServicesNeedRestart` in `test_linux.py` covers the shared command, the whole script running under `sudo -n`, and a refused sudo raising after one try. The new caller is also added to `test_sudo_without_password`'s list of privileged callers. The full suite passes (467 passed). Requires napalm-device-types >= 4.44.0. Release 0.19.0 (separate commit). Part of NetOrk/netork#2700 (option A).
christianmanivong added 2 commits 2026-11-26 16:40:39 +00:00
LinuxProcessReadingsMixin carries napalm-device-types' ServicesRestartMixin:
its command goes through the driver's sudo like the listening sockets, and
there is no unprivileged retry, since a reading of the login user's own
processes would read as clean.
chore(release): 0.19.0
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 14s
driver / test (3.12) (pull_request) Failing after 43s
driver / types (pull_request) Failing after 55s
driver / lowest (pull_request) Failing after 18s
driver / test (3.13) (pull_request) Failing after 39s
driver / build (pull_request) Successful in 28s
driver / security (pull_request) Failing after 57s
CI / driver (pull_request) Failing after 2m23s
driver / publish (pull_request) Skipped
1c5f17e7db
christianmanivong added 1 commit 2026-11-26 18:24:59 +00:00
chore(deps): napalm-device-types 4.45.0, where ServicesRestartMixin is released
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 17s
driver / types (pull_request) Successful in 1m8s
driver / test (3.13) (pull_request) Successful in 1m1s
driver / test (3.12) (pull_request) Successful in 1m14s
driver / lowest (pull_request) Successful in 30s
driver / build (pull_request) Successful in 31s
driver / security (pull_request) Successful in 1m6s
CI / driver (pull_request) Successful in 2m28s
driver / publish (pull_request) Skipped
902dceabd3
4.44.0 went out with other contracts first (NAPALM/napalm-device-types#133).
christianmanivong merged commit 670e62e0f0 into main 2026-11-26 18:59:42 +00:00
christianmanivong deleted branch feature/services-need-restart 2026-11-26 18:59:42 +00:00
Sign in to join this conversation.