Time and date problem Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
vonloschz
Posts: 34
Joined: Wed Apr 21, 2021 4:30 pm

Time and date problem

Post by vonloschz »

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 ?

Code: Select all

dietpi@pi4:~ $ sudo timedatectl status
Failed to create bus connection: No such file or directory

Thanks
User avatar
Joulinar
Posts: 4536
Joined: Sat Nov 16, 2019 12:49 am

Re: Time and date problem

Post by Joulinar »

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
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
vonloschz
Posts: 34
Joined: Wed Apr 21, 2021 4:30 pm

Re: Time and date problem

Post by vonloschz »

Thanks for the answer.

I update the NTP Mirror base on your info.
However, I still have a error message with

Code: Select all

root@pi4:/# timedatectl
Failed to create bus connection: No such file or directory
User avatar
Joulinar
Posts: 4536
Joined: Sat Nov 16, 2019 12:49 am

Re: Time and date problem

Post by Joulinar »

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
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
vonloschz
Posts: 34
Joined: Wed Apr 21, 2021 4:30 pm

Re: Time and date problem

Post by vonloschz »

timedatectl status and systemctl status systemd-timesyncd was the same thing for me.
Thank to point me out the correct way.
User avatar
Joulinar
Posts: 4536
Joined: Sat Nov 16, 2019 12:49 am

Re: Time and date problem

Post by Joulinar »

usually systemctl status systemd-timesyncd should display the status of the time sync service. In normal circumstances status is inactive

Code: Select all

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

Code: Select all

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:~#
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply