system timers ignoring time specified to execute a service

Talk about the project itself, the community, where we are and what we need. Great place to introduce yourself and make friends as well.

system timers ignoring time specified to execute a service

Postby bikram » Mon Dec 17, 2018 7:40 pm

down vote
favorite
I have various system timer files, each timer file should execute the specified service file at the time of the day which is specified in the timer file. It was all working as it should be before I upgraded the arch linux using the command: sudo pacman -Syu

Note: I am using the arch linux on Raspberry pi 3

Problem after upgrading:

One of the timer files we have is the daily_reboot.timer. This file should execute the daily_reboot.service file everyday at 1 am. So the system should reboot every night at 1 am because this timer file should execute the service file only at 1 am everyday. But for some reason, the system keeps rebooting and rebooting for whole time. Looking at logs and observing the pattern, I found that all the timer files are getting executed every time the system boots and the timer files are calling the service file every time, seems like timer files are ignoring the line which says the time (1 am in case of daily reboot) and service files get executed by ignoring the time specification in the timer file. This leads to constant rebooting of system because the daily reboot timer keeps calling the service file, which reboots the system and same thing repeats again.

If I disable the daily reboot timer, the system stops rebooting. sudo systemctl disable daily_reboot.timer This command deletes the symbolic link of that timer, and hence system does not see the daily reboot timer then.

But for our device, we need to have a daily reboot at 1 am everyday. This is necessary for my project. Can anyone help me here or did anyone experience this issue before ??

Image

Below is the code I have for the timer file:

[Unit]
Description=Restart RPi at 1AM timer

[Timer]
OnCalendar=*-*-* 01:00:00
Persistent=False

[Install]
WantedBy=timers.target
bikram
 
Posts: 2
Joined: Mon Dec 17, 2018 7:17 pm

Re: system timers ignoring time specified to execute a servi

Postby bulletmark » Tue Dec 18, 2018 2:49 am

Make sure you are not enabling the service file, only enable the timer file.

Also, I have had various issues running systemd timers etc on my RPi3 and I will tell you that the lack of a RTC causes problems at boot (like you are reporting) so it is essential on RPi's to `sudo systemctl enable systemd-time-wait-sync` to ensure that time is synced after boot before the timers.target is enabled.
bulletmark
 
Posts: 98
Joined: Tue Oct 13, 2015 10:17 pm

Re: system timers ignoring time specified to execute a servi

Postby bikram » Wed Dec 19, 2018 1:07 am

Thanks for your reply, I have tried what you suggested and it seems working.
Probably systemd timers were getting enabled before the RTC and system time were getting synced.
bikram
 
Posts: 2
Joined: Mon Dec 17, 2018 7:17 pm


Return to Community

Who is online

Users browsing this forum: No registered users and 4 guests