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).
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.
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.
LinuxProcessReadingsMixinnow carries napalm-device-types'ServicesRestartMixin(4.44.0, NAPALM/napalm-device-types branchfeature/services-need-restart). Its_run_services_restart_commandgoes through_run_privileged, the same path the listening sockets take: root directly,sudo -Swith a password,sudo -n sh -cwithout 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:
TestGetServicesNeedRestartintest_linux.pycovers the shared command, the whole script running undersudo -n, and a refused sudo raising after one try. The new caller is also added totest_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).