9️⃣ Here's the 9th post highlighting key new features of the upcoming v257 release of systemd. #systemd257

systemd has a powerful timer concept, that allows specification of calendar events (repetitive or not) in a relatively flexible, expressive way. When such a calendar timer elapses, the service unit associated with the timer unit gets activated. When it elapses again, it gets activated again, and so on.

But what happens if a calendar timer elapses while the service is still running?

Previously, when this happens the service would be reactivated immediately again once it terminates, ensuring that whenever the calendar expression elapses it is followed by at least one activation, executed eventually. (In the special case that the calendar elapses many times while the timer's service is still running, the service would be reactivated only once though).

With v257 there's a new option that allows modifying behaviour when this case happens:

DeferReactivation= is a new boolean option you can set on a timer unit. If you enable it, and a calendar timer elapses while the service is still running this is ignored. Reactivation only takes place once the timer unit elapses after the service was deactivated again.

And that's it. A small knob, but quite useful to avoid constant immediate reactivation of timers if the services they activate take too long to finish.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.