Both drivers (ProxmoxDriver, ProxmoxBackupDriver) mix in napalm-device-types' ServicesRestartMixin (NAPALM/napalm-device-types#132), so netOrk reads which services on a node still run code an update replaced on disk (NetOrk/netork#2750). A hypervisor is where restarting a service instead of the host matters most.
How.ProxmoxHostMixin._run_services_restart_command carries the mixin's one fixed, read-only command over the exec path (_exec_ssh_command), as _run_listening_sockets_command does; no stdin. The exec path is root's login as a rule, but a reading of another login's own processes would read as clean, so the command runs behind [ "$(id -u)" = 0 ] &&: another login prints nothing and the parse raises (no reading, not a clean one). On a node: needrestart in list-only mode where it is installed, else the /proc/<pid>/maps scan. A running VM's QEMU (qemu.slice/<vmid>.scope) is listed under processes; an LXC container's processes are left out by the parse (NAPALM/napalm-device-types#134), since a container updates itself.
Tests.tests/test_services_restart.py: both drivers declare the contract; the command goes over the exec path behind the root guard and parses a PVE node's output (pveproxy a unit, kvm a process, a container's nginx left out); PBS reads it the same way; as a non-root user the real guarded command prints nothing and the read raises. The whole suite: 702 passed locally; ruff and mypy clean.
Dependencies and version.
Needs napalm-device-types 4.46.0 (>=4.46.0): ServicesRestartMixin (#132, 4.45.0) with an LXC container's processes left out (#134, 4.46.0), and 0.14.0's CredentialExpiryMixin.
main (0.14.0, #76) is merged in, not rebased. The conflicts in CHANGELOG.md and pyproject.toml are resolved, and the whole suite passes on the merge: 744 passed locally against device-types #134's head.
The version is 0.16.0. main is 0.14.0, and #75 (feature/certificates-2656, #2656) takes 0.15.0. I re-checked the tags (v0.14.0 is the latest) before the merge.
CI is expected to be red until napalm-device-types 4.46.0 is released. pip cannot resolve the floor from the index; napalm-linux#86 is red for the same reason.
netOrk pins this branch in NetOrk/netork's feature/services-need-restart-drivers-2750.
Both drivers (`ProxmoxDriver`, `ProxmoxBackupDriver`) mix in napalm-device-types' `ServicesRestartMixin` (NAPALM/napalm-device-types#132), so netOrk reads which services on a node still run code an update replaced on disk (NetOrk/netork#2750). A hypervisor is where restarting a service instead of the host matters most.
**How.** `ProxmoxHostMixin._run_services_restart_command` carries the mixin's one fixed, read-only command over the exec path (`_exec_ssh_command`), as `_run_listening_sockets_command` does; no stdin. The exec path is root's login as a rule, but a reading of another login's own processes would read as clean, so the command runs behind `[ "$(id -u)" = 0 ] &&`: another login prints nothing and the parse raises (no reading, not a clean one). On a node: `needrestart` in list-only mode where it is installed, else the `/proc/<pid>/maps` scan. A running VM's QEMU (`qemu.slice/<vmid>.scope`) is listed under `processes`; an LXC container's processes are left out by the parse (NAPALM/napalm-device-types#134), since a container updates itself.
**Tests.** `tests/test_services_restart.py`: both drivers declare the contract; the command goes over the exec path behind the root guard and parses a PVE node's output (pveproxy a unit, kvm a process, a container's nginx left out); PBS reads it the same way; as a non-root user the real guarded command prints nothing and the read raises. The whole suite: 702 passed locally; ruff and mypy clean.
**Dependencies and version.**
- Needs napalm-device-types **4.46.0** (`>=4.46.0`): `ServicesRestartMixin` (#132, 4.45.0) with an LXC container's processes left out (#134, 4.46.0), and 0.14.0's `CredentialExpiryMixin`.
- `main` (0.14.0, #76) is merged in, not rebased. The conflicts in `CHANGELOG.md` and `pyproject.toml` are resolved, and the whole suite passes on the merge: 744 passed locally against device-types #134's head.
- The version is **0.16.0**. `main` is 0.14.0, and #75 (`feature/certificates-2656`, #2656) takes 0.15.0. I re-checked the tags (v0.14.0 is the latest) before the merge.
**CI is expected to be red** until napalm-device-types 4.46.0 is released. pip cannot resolve the floor from the index; napalm-linux#86 is red for the same reason.
netOrk pins this branch in NetOrk/netork's `feature/services-need-restart-drivers-2750`.
Both drivers mix in napalm-device-types' ServicesRestartMixin. The command
goes over the exec path, root's login as a rule, behind an id -u guard: a
login other than root would see only its own processes and read as
clean, so it prints nothing and the read raises. A running VM's QEMU is
listed as a process; an LXC container's processes are left out by the
parse, since a container updates itself. No stdin.
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.
Both drivers (
ProxmoxDriver,ProxmoxBackupDriver) mix in napalm-device-types'ServicesRestartMixin(NAPALM/napalm-device-types#132), so netOrk reads which services on a node still run code an update replaced on disk (NetOrk/netork#2750). A hypervisor is where restarting a service instead of the host matters most.How.
ProxmoxHostMixin._run_services_restart_commandcarries the mixin's one fixed, read-only command over the exec path (_exec_ssh_command), as_run_listening_sockets_commanddoes; no stdin. The exec path is root's login as a rule, but a reading of another login's own processes would read as clean, so the command runs behind[ "$(id -u)" = 0 ] &&: another login prints nothing and the parse raises (no reading, not a clean one). On a node:needrestartin list-only mode where it is installed, else the/proc/<pid>/mapsscan. A running VM's QEMU (qemu.slice/<vmid>.scope) is listed underprocesses; an LXC container's processes are left out by the parse (NAPALM/napalm-device-types#134), since a container updates itself.Tests.
tests/test_services_restart.py: both drivers declare the contract; the command goes over the exec path behind the root guard and parses a PVE node's output (pveproxy a unit, kvm a process, a container's nginx left out); PBS reads it the same way; as a non-root user the real guarded command prints nothing and the read raises. The whole suite: 702 passed locally; ruff and mypy clean.Dependencies and version.
>=4.46.0):ServicesRestartMixin(#132, 4.45.0) with an LXC container's processes left out (#134, 4.46.0), and 0.14.0'sCredentialExpiryMixin.main(0.14.0, #76) is merged in, not rebased. The conflicts inCHANGELOG.mdandpyproject.tomlare resolved, and the whole suite passes on the merge: 744 passed locally against device-types #134's head.mainis 0.14.0, and #75 (feature/certificates-2656, #2656) takes 0.15.0. I re-checked the tags (v0.14.0 is the latest) before the merge.CI is expected to be red until napalm-device-types 4.46.0 is released. pip cannot resolve the floor from the index; napalm-linux#86 is red for the same reason.
netOrk pins this branch in NetOrk/netork's
feature/services-need-restart-drivers-2750.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.