Hello.
I have a few questions for you.
Does dietpi interface support to change ntp server ?
Why timedatectl vs chrony ?
and how could I solve this error ?
dietpi@pi4:~ $ sudo timedatectl status
Failed to create bus connection: No such file or directory
Thanks
Hi,
Usually time sync is done during boot and on daily basis. NTP server can be changed via dietpi-config.
dietpi-config > 8 : Network Options: Misc > NTP Mirror
To run a time sync you can do systemctl start systemd-timesyncd or /boot/dietpi/func/run_ntpd
Thanks for the answer.
I update the NTP Mirror base on your info.
However, I still have a error message with
root@pi4:/# timedatectl
Failed to create bus connection: No such file or directory
Pls use date to check current time or systemctl start systemd-timesyncd to sync time with an NTP server. By default dbus is not active/installed
timedatectl status and systemctl status systemd-timesyncd was the same thing for me.
Thank to point me out the correct way.
usually systemctl status systemd-timesyncd should display the status of the time sync service. In normal circumstances status is inactive
root@DietPiProd:~# systemctl status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; disabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/systemd-timesyncd.service.d
└─disable-with-time-daemon.conf
Active: inactive (dead)
Docs: man:systemd-timesyncd.service(8)
As well you will see a couple of lines from the log. To display the full log, just run journalctl -u systemd-timesyncd
root@DietPiProd:~# journalctl -u systemd-timesyncd
-- Logs begin at Sat 2021-04-17 12:19:23 CEST, end at Wed 2021-04-21 22:55:52 CEST. --
Apr 17 12:19:26 DietPiProd systemd[1]: Starting Network Time Synchronization...
Apr 17 12:19:26 DietPiProd systemd[1]: Started Network Time Synchronization.
Apr 17 12:19:36 DietPiProd systemd-timesyncd[492]: Timed out waiting for reply from 192.168.0.1:123 (192.168.0.1).
Apr 17 12:20:20 DietPiProd systemd-timesyncd[492]: Synchronized to time server for the first time 192.168.0.1:123 (192.168.0.1).
Apr 17 12:20:20 DietPiProd systemd[1]: Stopping Network Time Synchronization...
Apr 17 12:20:20 DietPiProd systemd[1]: systemd-timesyncd.service: Succeeded.
Apr 17 12:20:20 DietPiProd systemd[1]: Stopped Network Time Synchronization.
Apr 18 01:25:01 DietPiProd systemd[1]: Starting Network Time Synchronization...
Apr 18 01:25:01 DietPiProd systemd[1]: Started Network Time Synchronization.
Apr 18 01:25:01 DietPiProd systemd-timesyncd[8505]: Synchronized to time server for the first time 192.168.0.1:123 (192.168.0.1).
Apr 18 01:25:01 DietPiProd systemd[1]: Stopping Network Time Synchronization...
Apr 18 01:25:01 DietPiProd systemd[1]: systemd-timesyncd.service: Succeeded.
Apr 18 01:25:01 DietPiProd systemd[1]: Stopped Network Time Synchronization.
Apr 19 01:25:01 DietPiProd systemd[1]: Starting Network Time Synchronization...
Apr 19 01:25:01 DietPiProd systemd[1]: Started Network Time Synchronization.
Apr 19 01:25:00 DietPiProd systemd-timesyncd[21684]: Synchronized to time server for the first time 192.168.0.1:123 (192.168.0.1).
Apr 19 01:25:00 DietPiProd systemd[1]: Stopping Network Time Synchronization...
Apr 19 01:25:00 DietPiProd systemd[1]: systemd-timesyncd.service: Succeeded.
Apr 19 01:25:00 DietPiProd systemd[1]: Stopped Network Time Synchronization.
Apr 20 01:25:01 DietPiProd systemd[1]: Starting Network Time Synchronization...
Apr 20 01:25:01 DietPiProd systemd[1]: Started Network Time Synchronization.
Apr 20 01:25:00 DietPiProd systemd-timesyncd[554]: Synchronized to time server for the first time 192.168.0.1:123 (192.168.0.1).
Apr 20 01:25:00 DietPiProd systemd[1]: Stopping Network Time Synchronization...
Apr 20 01:25:00 DietPiProd systemd[1]: systemd-timesyncd.service: Succeeded.
Apr 20 01:25:00 DietPiProd systemd[1]: Stopped Network Time Synchronization.
Apr 21 01:25:01 DietPiProd systemd[1]: Starting Network Time Synchronization...
Apr 21 01:25:01 DietPiProd systemd[1]: Started Network Time Synchronization.
Apr 21 01:25:00 DietPiProd systemd-timesyncd[11780]: Synchronized to time server for the first time 192.168.0.1:123 (192.168.0.1).
Apr 21 01:25:00 DietPiProd systemd[1]: Stopping Network Time Synchronization...
Apr 21 01:25:00 DietPiProd systemd[1]: systemd-timesyncd.service: Succeeded.
Apr 21 01:25:00 DietPiProd systemd[1]: Stopped Network Time Synchronization.
root@DietPiProd:~#