[OE-core] Incorrect systemd timer


Khem Raj
 

On 9/26/21 6:29 PM, JH wrote:
Hi,
I set up a service timer to run the service every minute at times
01:10:50, 01:10:50, 01:10:50, ...
[Unit]
Description=Run watchdog job at every 1 minute
[Timer]
Unit=mwatchdog.service
OnCalendar=*-*-* *:00:50
perhaps use
OnCalendar=*-*-* *:*:00



Persistent=true
[Install]
WantedBy=timers.target
But the timer was actually fired about every 8 - 9 seconds:
Mon Sep 27 01:10:06 UTC 2021 start timer
Mon Sep 27 01:10:15 UTC 2021 start timer
Mon Sep 27 01:10:23 UTC 2021 start timer
Not quite sure if it is a kernel issue or Yocto oe-core build issue or
what I could be missing, appreciate your advice.
Thank you.
Kind regards,
- jupiter


JH
 

perhaps use
OnCalendar=*-*-* *:*:00
No, the same result, completely bewildered why the timer does not work
in Yocto Linux

Thanks Khem.


Manuel Wagesreither
 

Am Di, 28. Sep 2021, um 03:43, schrieb JH:
perhaps use
OnCalendar=*-*-* *:*:00
No, the same result, completely bewildered why the timer does not work
in Yocto Linux
Is the timer unit shadowed by some other timer?

Mind that units can live in
* `/lib/systemd/system/`,
* `/etc/systemd/system/`,
* `/run/systemd/system/`
and there's a priority.

Check here: https://www.freedesktop.org/software/systemd/man/systemd.unit.html

Didn't check, but I guess when you `systemctl status your.timer`, it shows the unit in effect. At least with service unit it does. `systemctl cat your.timer` should do this as well.

Regards, Manuel