From 760758755039753904ddfb514b8850ab32d98353 Mon Sep 17 00:00:00 2001 From: Nick Anderson Date: Thu, 11 Jun 2026 12:54:16 -0500 Subject: [PATCH 1/2] Added timer_policy attribute to classes: promise reference Documents the timer_policy attribute on classes: promises (CFE-4681), which controls whether a persistent class restarts its timer when rediscovered. The default is reset on master (3.28.0); the attribute is also available on 3.24.5 and 3.27.2, where the default is absolute. Ticket: CFE-4681 --- .../reference/promise-types/classes.markdown | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/content/reference/promise-types/classes.markdown b/content/reference/promise-types/classes.markdown index baf1feb3f..cf2cbe043 100644 --- a/content/reference/promise-types/classes.markdown +++ b/content/reference/promise-types/classes.markdown @@ -356,6 +356,53 @@ classes: **See also:** [`persistence` classes attribute][classes#persistence], [`persist_time` in classes body][Promise types#persist_time] +### timer_policy + +**Description:** Determines whether a persistent class restarts its counter +when rediscovered. + +When a [`persistence`][classes#persistence] timer is set, `timer_policy` +controls what happens on later runs while the class is still defined (loaded +from the persistent store): + +- `reset` re-evaluates the promise and restarts the timer, so the class keeps + persisting for as long as the policy keeps running and the expression stays + true. +- `absolute` preserves the original expiry. While the class is already defined + the promise is skipped, so the class disappears once the original timer + elapses, regardless of how often the policy runs. + +This is the counterpart of `timer_policy` in the classes body, which has always +defaulted to `reset`. + +**Type:** (menu option) + +**Allowed input range:** `absolute|reset` + +**Default value:** reset + +**Example:** + +```cf3 {skip TODO} +bundle common setclasses +{ + classes: + "cached_class" + expression => "any", + persistence => "120", + timer_policy => "reset"; +} +``` + +**History:** + +- Introduced in CFEngine 3.24.5, 3.27.2, and 3.28.0. +- The default is `reset` as of 3.28.0. In 3.24.5 and 3.27.2 (and later patch + releases in those series) the default is `absolute`, preserving the prior + behavior. + +**See also:** [`persistence` classes attribute][classes#persistence], [`timer_policy` in classes body][Promise types#timer_policy], [`persist_time` in classes body][Promise types#persist_time] + ### not **Description:** Evaluate the negation of string expression in normal form From a26ef91a02c3f7a570e0d25057aa956f91aefc9f Mon Sep 17 00:00:00 2001 From: Nick Anderson Date: Wed, 8 Jul 2026 15:43:53 -0500 Subject: [PATCH 2/2] Reformat regline.markdown cf3 example per cfengine CLI 0.18.0 cfengine dev format-docs now reformats cf3 code blocks (cfengine CLI 0.18.0), and expects a blank line between the classes: and insert_lines: promise types in the example. Add it so the Lint and format check passes. --- content/reference/functions/regline.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/content/reference/functions/regline.markdown b/content/reference/functions/regline.markdown index 767ee2686..e1271407e 100644 --- a/content/reference/functions/regline.markdown +++ b/content/reference/functions/regline.markdown @@ -42,6 +42,7 @@ bundle edit_line upgrade_cfexecd # bundles and persist until it is explicitly canceled or until the end of # the agent run. scope => "bundle"; + insert_lines: exec_fix:: "0,5,10,15,20,25,30,35,40,45,50,55 * * * * /var/cfengine/bin/cf-execd -F";