feat(scheduled-jobs): OMV's own jobs through Cron RPC, generated files platform (#18)
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 14s
driver / test (3.12) (pull_request) Failing after 46s
driver / test (3.13) (pull_request) Failing after 43s
driver / types (pull_request) Failing after 1m1s
driver / lowest (pull_request) Failing after 20s
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Failing after 1m4s
CI / driver (pull_request) Failing after 2m16s
driver / publish (pull_request) Skipped

OpenMediaVault writes several cron files itself, from its own database,
and writes them again on every apply: an edit napalm-linux made there
would be taken back without a word. So every file OMV generates
(/etc/cron.d/openmediavault-*, the mail-queue flush, apticron and the
recycle-bin cleanup) is platform and only runs; the inherited writers
refuse it.

The web UI's "Scheduled Jobs" and the power-management schedule live in
conf.system.cron.job. They are read through Cron.getList, disabled ones
included, instead of the lines OMV generates for them, and switched with
Cron.set, run with Cron.execute (followed through Exec.getOutput), made
with Cron.set and removed with Cron.delete. An application's job on OMV is
an OMV job, visible in its web UI, marked by its comment. Each write
applies the cron module alone, so changes pending in the web UI for other
modules stay pending. Every other job keeps napalm-linux's behaviour.

Requires napalm-device-types 4.26.0 and napalm-linux 0.16.0.

Closes #18
This commit is contained in:
Christian Manivong committed 2026-11-03 05:46:23 +01:00
1 parent a0d28fc939
commit cc00c225a2
6 files changed
+1137 -7

No files matched your search

+9 -2
View File
@@ -5,7 +5,7 @@ NAPALM driver for [OpenMediaVault](https://www.openmediavault.org/) NAS systems,
[napalm-linux](https://git.netork.io/NAPALM/napalm-linux) (`LinuxDriver`).
OpenMediaVault is Debian underneath, so the driver inherits everything napalm-linux does for a
Linux host (packages, updates, services, users, processes, cron, Docker) and adds the NAS side:
Linux host (packages, updates, services, users, processes, scheduled jobs, Docker) and adds the NAS side:
disks, md RAID arrays, filesystems, shares and the NAS services.
## Tested against
@@ -40,7 +40,14 @@ with driver("192.0.2.10", "admin", "secret", optional_args={"sudo_password": "se
| `get_volumes` | mounted block-device filesystems from `df`, read-only flag from `/proc/mounts` |
| `get_shares` | SMB, NFS and FTP shares from OMV's configuration database (`omv-confdbadm`) |
| `get_storage_services` | whether `smbd`, `nfs-server`, `proftpd`, `ssh` and `rsync` are enabled and running |
| everything of napalm-linux | packages, updates, services, users, processes, cron, Docker, … |
| `get_scheduled_jobs` | napalm-linux's reading of the host, but the web UI's "Scheduled Jobs" and the power-management schedule come from `Cron.getList` (`omv:<uuid>`, disabled ones too) instead of the lines OMV generates for them; the cron files OMV generates (`/etc/cron.d/openmediavault-*`, `openmediavault-flushmailq`, `-apticron`, `-samba-recycle`) are `platform` and only run |
| `manage_scheduled_job` | an OMV job: `Cron.set` with only `enable` changed, or `Cron.execute` followed through `Exec.getOutput` (stopped after 300 s); a power-management job is not run; anything else as napalm-linux, never a generated file |
| `put_scheduled_job` | an OMV job through `Cron.set`, in the web UI like any other, its comment `napalm-scheduled-job: <name> <description>`; a multi-line command is fine |
| `delete_scheduled_job` | an application's OMV job through `Cron.delete`; an application's Linux job as napalm-linux |
| everything of napalm-linux | packages, updates, services, users, processes, Docker, … |
Every scheduled-job write through RPC deploys the `cron` module alone (`Config.applyChanges`):
changes left pending in the web UI for other modules stay pending.
"Upgrade everything" is a full upgrade (`FULL_UPGRADE = True`): a plain `apt-get upgrade` holds
back OpenMediaVault's own packages and the kernel.