[systemd-devel] delayed start 'on calendar' timers - is it possible?

Lennart Poettering lennart at poettering.net
Thu Dec 13 21:21:47 UTC 2018


On Do, 13.12.18 22:06, Kamil Jońca (kjonca at o2.pl) wrote:

> %cat /etc/systemd/system/kjonca-daily.timer
> [Unit]
> Description=kjonca daily
>
> [Timer]
> OnBootSec=0

Well, with this you say that your timer shall be started right after
booting. That's a fixed point in time, and when you start the timer
unit this triggers that the service is immediately started, as systemd
notices that that fixed point in time is already in the past, so it
catches up. Drop this line and things should work.

Note that if you need two timer triggers for the same unit you have
two options: declare them in the same .timer unit file, but then they
are treated as a single object, and hence are activated together and
have all other settings applied to them both. Or you split them into
two timer units, and use Unit= to make sure both start the same
service unit. Then you can have different settings and lifecycles for
both timer units.

Lennart

--
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list