time sync with gateway via systemd-timesyncd not working
Creating a bug report/issue
The issue seems that the configuration of a time-server is overwritten at each boot. That leads to systemd-timesync using the standard time server. If dietpi is used as a pihole-unbound-DNS-resolver this leads to a failed time sync as the certificates are invalid due to a old system time (july 2021).
Required Information
- DietPi version |
cat /boot/dietpi/.versionG_DIETPI_VERSION_CORE=8 G_DIETPI_VERSION_SUB=5 G_DIETPI_VERSION_RC=1 G_GITBRANCH='master' G_GITOWNER='MichaIng' - Distro version |
echo $G_DISTRO_NAME $G_RASPBIANbullseye 1 - Kernel version |
uname -aLinux rpi2 5.15.32-v7+ #1538 SMP Thu Mar 31 19:38:48 BST 2022 armv7l GNU/Linux - SBC model |
echo $G_HW_MODEL_NAMEor (EG: RPi3) RPi 2 Model B (armv7l) - Power supply used | (EG: 5V 1A RAVpower)
- SD card used | (EG: SanDisk ultra)
Additional Information (if applicable)
-
Software title | (EG: Nextcloud) systemd-timesyncd
-
Was the software title installed freshly or updated/migrated? migrated from previous rpi / raspbian version
-
Can this issue be replicated on a fresh installation of DietPi? unknown
-
Bug report ID |
echo $G_HW_UUID6ccb9673-7106-45cb-85ec-25bc925a96d9
Steps to reproduce
- Install pihole
- install and use unbound as dns resolver
- reboot
- DNS-resolving does not work
- pihole says something like "certificate invalid"
- check system time: realize the date is totally wrong
- set ntp_server to ip adress of gateway in /etc/systemd/systemd_timesyncd
- systemctl restart systemd_timesync
- resolving works
- reboot
- DNS-resolving does not work
- check /etc/systemd/systemd_timesyncd and realize that ntp_server is unset again
Expected behaviour
- time server should be set to gateway ip.
- syncing time with gateway no problem as we use the ip of the gateway
Actual behaviour
See at "steps to reproduce"
Extra details
did you tried using dietpi-config > 8 : Network Options: Misc > NTP Mirror
For me this is working without issuing using my own NTP server. Anyway even using a global debian NTP server should update your system time automatically during boot and at least once a day. Can you share the logs and configuration
cat /boot/dietpi.txt | grep CONFIG_NTP
journalctl -u systemd-timesyncd.service
Did you changed CPU frequency below 300 MHz?
Also you mean the NTP= setting /etc/systemd/timesyncd.conf, don't you? Of course any change to is should be persistent. If it is not, then the underlying filesystem/drive seems to have issues syncing the change, e.g. when it's still in filesystem cache and the server crashes or due to some filesystem corruption.
Correct, I'm taking about the NTP= setting /etc/systemd/timesyncd.conf.
Changes are definitely not persistent, i have to change the setting after each reboot. (I did several tests)
I cannot rule out drive or file system issues, but this is the only file having this kind of problem. I will try another sd card after my holidays.
Am 23. Juli 2022 13:32:10 UTC schrieb MichaIng @.***>:
Also you mean the
NTP=setting/etc/systemd/timesyncd.conf, don't you? Of course any change to is should be persistent. If it is not, then the underlying filesystem/drive seems to have issues syncing the change, e.g. when it's still in filesystem cache and the server crashes or due to some filesystem corruption.-- Reply to this email directly or view it on GitHub: https://github.com/MichaIng/DietPi/issues/5642#issuecomment-1193126331 You are receiving this because you authored the thread.
Message ID: @.***>
Any other change to this filesystem is persistent, e.g. when you create a test file just in the same directory?
Can you show:
ls -l /etc/systemd/timesyncd.conf
A short test yesterday showed that there is some kind of (probably hardware) issue. This might be the cause of the problems. Due to holidays I'm not able to narrow down the hardware problem or do a fresh install right now. Feel free to mark this issue as solved or paused or similar, i will give feedback after my holidays.
Thanks a lot for the fast support so far!
Am 11. August 2022 05:46:32 UTC schrieb MichaIng @.***>:
Any other change to this filesystem is persistent, e.g. when you create a test file just in the same directory?
Can you show:
ls -l /etc/systemd/timesyncd.conf-- Reply to this email directly or view it on GitHub: https://github.com/MichaIng/DietPi/issues/5642#issuecomment-1211573771 You are receiving this because you authored the thread.
Message ID: @.***>
I'll mark this as closed for now. Feel free to reopen if the issue persists.
Ah sorry - I forgot to answer. Problem was a hardware issue. Problem was gone with new hardware. Can stay closed :) Thanks for the support and all the work on dietpi!!!