ALARM_D
Schedules and executes recurring or one-shot events defined in the
configured alarms directory (ALARMS_PATH) or registered at runtime.
Re-evaluates the full alarm list once per wall-clock minute and
dispatches any alarm whose pattern matches the current minute. See the
alarm system for types, file format, and patterns.
# publicvarargs add_once
Registers a one-shot ("O" type) alarm at runtime — a thin wrapper
around add_alarm() that fixes the type to "O". Throws if any of
master, pattern, file, or func is null.
"true" if the alarm targets the master file, anything else otherwise YY-MM-DD@HH:MM form # publicvarargs add_alarm
Registers an alarm of any type at runtime. Builds and validates the
alarm, appends it to the in-memory list, and persists it. Throws if
any of type, master, pattern, file, or func is null. Note
that reload_alarms() discards any alarm not present on disk.
O, H, D, W, M, Y); B alarms must come from config files "true" if the alarm targets the master file # public remove_alarm
Removes an alarm by its generated id and persists the change.
create_alarm() # public find_alarm_by_id
Looks up a single alarm by its unique id.
# public query_alarms
Returns all currently registered alarms.
# public reload_alarms
Rebuilds the in-memory list from disk — clears the current alarms,
scans ALARMS_PATH for *.txt files, parses each, and persists the
result. Discards any alarms added at runtime.
# public create_alarm
Builds and validates an alarm from parsed parts in the order
({ type, pattern, master, file, func, args... }). Assigns a
UUID-based id. Returns null if the parts list is too short or
validation fails.
# public calculate_alarm_time
Computes the next execution time for an alarm based on its type and pattern.
# public validate_alarm
Validates an alarm: target file exists and loads, target function
exists, and (for "O" alarms) the time is not in the past.
# public time_to_next_poll
Reports how long until the next scheduled poll.
# public poll_alarms
The scheduling engine. Re-schedules itself for the start of the next minute, then fires every alarm whose occurrence falls in the current minute and has not already run, cleaning up expired one-shots.
# public execute_boot_alarms
Handler for SIG_SYS_BOOT. Schedules every "B" (Boot) alarm to run
after its configured seconds-after-boot delay. Rejects callers other
than the signal daemon.
# private execute_alarm
Loads an alarm’s target file and invokes its handler with the alarm’s
arguments. Any failure is logged to system/alarm rather than
propagated.