fix(scheduled-jobs): a monotonic timer as its unit file says it, OnUnitActiveSec
driver / standard (pull_request) Successful in 14s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 57s
driver / test (3.12) (pull_request) Successful in 1m12s
driver / lowest (pull_request) Successful in 43s
driver / test (3.13) (pull_request) Successful in 1m14s
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Successful in 1m8s
CI / driver (pull_request) Successful in 2m47s
driver / publish (pull_request) Skipped

systemctl show names a timer's monotonic settings by their properties,
OnUnitActiveUSec=3h; the schedule now reads as the unit file writes it.
Found on a live Ubuntu host.

Refs #86
This commit is contained in:
christianmanivong committed 2026-11-03 08:11:48 +01:00
1 parent ffbb194300
commit c6d119eb83
2 files changed
+8 -3

No files matched your search

+7 -2
View File
@@ -203,8 +203,13 @@ def _timestamp(value: str) -> str | None:
def _timer_entries(block: dict[str, list[str]], key: str) -> list[str]:
"""``{ OnCalendar=daily ; next_elapse=… }`` → ``OnCalendar=daily``, one per entry."""
return [v.strip(" {}").split(" ; ")[0].strip() for v in block.get(key, []) if v.strip()]
"""``{ OnCalendar=daily ; next_elapse=… }`` → ``OnCalendar=daily``, one per entry.
``systemctl show`` names a monotonic setting by its property (``OnUnitActiveUSec``);
it is given as the unit file says it (``OnUnitActiveSec``).
"""
entries = (v.strip(" {}").split(" ; ")[0].strip() for v in block.get(key, []) if v.strip())
return [re.sub(r"^(On\w+)USec=", r"\1Sec=", e) for e in entries]
def _argv(exec_start: list[str]) -> str:
+1 -1
View File
@@ -33,7 +33,7 @@ FragmentPath=/usr/lib/systemd/system/apt-daily.timer
Id=fstrim.timer
Unit=fstrim.service
Description=Discard unused blocks once a week
TimersMonotonic={ OnUnitActiveSec=1w ; next_elapse=n/a }
TimersMonotonic={ OnUnitActiveUSec=1w ; next_elapse=n/a }
NextElapseUSecRealtime=n/a
LastTriggerUSec=n/a
UnitFileState=static