From 4e7e29b598a638a7f2e66f3c81d3a580c428367c Mon Sep 17 00:00:00 2001 From: Christian Manivong Date: Tue, 3 Nov 2026 05:40:27 +0100 Subject: [PATCH] docs(scheduled-jobs): a vzdump line only runs because of pmxcfs (#56) The guard is not about the link: napalm-device-types now writes the file a link names. /etc/cron.d/vzdump points into /etc/pve, the cluster file system, where installing a file with a mode and owner is not safe. Refs #56 --- CHANGELOG.md | 3 ++- napalm_proxmox/driver.py | 2 +- napalm_proxmox/scheduled_jobs.py | 4 ++-- tests/test_scheduled_jobs.py | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2746734..5dcff46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 What Proxmox ships is `platform`: on Proxmox VE `pve-*` units (`pve-daily-update.timer`), `pvesr.timer` and `/etc/cron.d/vzdump`; on a backup server `proxmox-backup*` units (`proxmox-backup-daily-update.timer`). A line in `/etc/cron.d/vzdump` is only run, never - switched: the file is a link into `/etc/pve`, and rewriting it would replace the link. + switched: the file is a link to `/etc/pve/vzdump.cron` on the cluster file system + (pmxcfs), where installing a file with a mode and owner is not safe. Not scheduled jobs here: Proxmox VE's backup jobs (`/cluster/backup`) and replication, and a backup server's verify, prune, sync and garbage collection jobs. Proxmox runs them in its own daemons; `get_clusters()` and `get_backup_jobs()` keep them. diff --git a/napalm_proxmox/driver.py b/napalm_proxmox/driver.py index 4241bc5..137b5c0 100644 --- a/napalm_proxmox/driver.py +++ b/napalm_proxmox/driver.py @@ -119,7 +119,7 @@ class ProxmoxDriver( FULL_UPGRADE = True #: Proxmox VE's own timers and cron file are ``platform``. PLATFORM_SOURCES = PVE_PLATFORM_SOURCES - #: ``/etc/cron.d/vzdump`` links into ``/etc/pve``; its lines are only run. + #: ``/etc/cron.d/vzdump`` links into ``/etc/pve`` (pmxcfs); its lines are only run. RUN_ONLY_SOURCES = ("/etc/cron.d/vzdump",) PORT_SPECS = [ PortSpec("https", 8006, weight=8.0), diff --git a/napalm_proxmox/scheduled_jobs.py b/napalm_proxmox/scheduled_jobs.py index d38c340..0aa3b4c 100644 --- a/napalm_proxmox/scheduled_jobs.py +++ b/napalm_proxmox/scheduled_jobs.py @@ -39,8 +39,8 @@ PBS_PLATFORM_SOURCES = tuple(f"{d}/proxmox-backup*" for d in _UNITS) class ProxmoxScheduledJobsMixin(PosixScheduledJobsMixin): """Scheduled jobs of a Proxmox host; a driver sets ``PLATFORM_SOURCES``.""" - #: Sources a job is only run from: links into ``/etc/pve``, which a rewrite - #: (``install`` over the path) would replace with a file of its own. + #: Sources a job is only run from: links into ``/etc/pve``, the cluster file system + #: (pmxcfs), where a switch's ``install`` with a mode and owner is not safe. RUN_ONLY_SOURCES: ClassVar[tuple[str, ...]] = () def _sj_read(self) -> Reading: diff --git a/tests/test_scheduled_jobs.py b/tests/test_scheduled_jobs.py index 9f93aea..4a274a4 100644 --- a/tests/test_scheduled_jobs.py +++ b/tests/test_scheduled_jobs.py @@ -128,7 +128,7 @@ def test_what_a_backup_server_ships_is_platform() -> None: def test_a_vzdump_cron_line_only_runs() -> None: - """``/etc/cron.d/vzdump`` links into ``/etc/pve``; switching it would replace the link.""" + """``/etc/cron.d/vzdump`` links into pmxcfs (``/etc/pve``), where no switch writes.""" driver = _driver(ProxmoxDriver, PVE_REPORT) job = _by_source(driver)["/etc/cron.d/vzdump"] assert job["actions"] == ["run"]