[systemd-devel] timesyncd on systems without battery

Dan Tihelka dtihelka at gmail.com
Sun Jan 3 09:39:54 UTC 2021


Hello,
I run systemd on a NAS without internal-clock-holding battery, so I think that 
the systemd-timesyncd sets the time to the last known value after restart and 
syncs it from the network when on-line. Is it right?

Now, I have a shutdown timer unit, which powers the NAS off at the given time.
However, sometimes (about 50% of cases), when the device is powerd-on, it 
switches off immediately. When switched-on again, it boots as expected.

The question is, is there a way of fixing the issue? I have tried to add sleep 
to skip to the next minute, but unsuccessfully.

Thank you,
DT


Here are the unit files.
timer:

[Unit]
Description=Poweroff the system on scheduled time

[Timer]
# Power off at the given time
OnCalendar=Mon,Tue,Wed,Thu,Fri *-*-* 01:10:00
OnCalendar=Sat,Sun             *-*-* 01:55:00

[Install]
WantedBy=timers.target

---
service:

[Unit]
Description=Poweroff the system

[Service]
Type=oneshot
ExecStart=/bin/sleep 80
ExecStart=/usr/bin/systemctl poweroff






More information about the systemd-devel mailing list