Scheduled jobs: ScheduledJobsMixin contract, POSIX cron and systemd timer readers and writers #86
Notifications
Due Date
No due date set.
Blocks
Depends on
#67 Scheduled jobs: Linux
NAPALM/napalm-linux
#18 Scheduled jobs: OpenMediaVault
NAPALM/napalm-openmediavault
#32 Scheduled jobs: OpenWrt
NAPALM/napalm-openwrt
#43 Scheduled jobs: OPNsense
NAPALM/napalm-opnsense
#56 Scheduled jobs: Proxmox VE and Proxmox Backup Server
NAPALM/napalm-proxmox
#17 Scheduled jobs: QNAP QTS
NAPALM/napalm-qnap-qts
#8 Scheduled jobs: Windows
NAPALM/napalm-windows
#27 Scheduled jobs: FreeBSD and OpenBSD
NAPALM/napalm-bsd
You do not have permission to read 2 dependencies
You do not have permission to read 1 dependency
Reference: NAPALM/napalm-device-types#86
Reference in new issue
Block a user
Part of NetOrk/netork#1933. Priority: P3 — important, not urgent (the NAPALM org has no labels, so it is stated here).
Blocks every driver issue of the epic — the contract has to stand before they run in parallel.
Contract
ScheduledJobsMixin(likeServiceControlMixin),ScheduledJobDict:keytimer:<unit>,cron:<path>:<digest of the normalised line>[:n],run-parts:<dir>/<script>,task:<path><name>,opnsense:<uuid>,omv:<uuid>…kindcron/run_parts/anacron/systemd_timer/periodic/tasksourcerun_asschedule,schedule_kindcron/calendar(OnCalendar) /monotonic(OnBootSec …) /period(anacron, periodic) /triggers(Windows)commandenabledmanaged_bypackage/admin/platform/netorklast_run,last_result,next_rundescriptionMethods:
get_scheduled_jobs(),manage_scheduled_job(key, action, *, expected_hash)withenable/disable/run, andput_scheduled_job(spec, *, expected_hash=None)/delete_scheduled_job(key, *, expected_hash)for netOrk's own. A verb a driver cannot do is refused explicitly (Noneattribute, asmanage_service), never pretended.Shared implementations (POSIX hosts)
/etc/crontab,/etc/cron.d/*, user crontabs (/var/spool/cron/crontabs,/var/spool/cron,/etc/crontabs), run-parts directories,/etc/anacrontab— one framed round trip, root through fixed commands (find … -print0,cat --), a truncated report raises.@schedules, variables,%,#inside a command handled correctly.list-timers --all+ onesystemctl showover all timers and their units (TimersCalendar,TimersMonotonic,NextElapseUSecRealtime,LastTriggerUSec,Result,UnitFileState,FragmentPath, the unit'sExecStart/User/ExecMainStatus) — one round trip.managed_by: one batched package-database query (dpkg -S/rpm -qf/apk info -W) over all definition files.# netork-disabled:; own job asnetork-<slug>.timer/.serviceor/etc/cron.d/netork-<slug>;systemd-analyze calendar/verifybefore a timer is installed; the expected hash checked right before the write.chmod -xis undone by the next package upgrade —dpkg-statoverridekeeps it; to be settled here.cron.dailyscripts exit when systemd runs, because a timer does the work — a job shown twice must be recognisable as such.Replaces
get_cron_jobs()andCronJobDictare removed, not kept beside the new contract — nothing in netOrk calls them.Merged with #87, v4.27.0.