Date/Time synchronization
-
@mitu Ha ? I saw that ntd was not use anymore and maybe timedatectl was used in place.
-
@joecool timedatectl is only setting/reading the date, does not speak NTP. You're probably thinking about
systemd-timesyncd
, but I don't think that's installed in Raspbian. -
@mitu You're probably right. My problem is to know how this sync works. I'm sorry, but there is a blur in my mind about that time sync.
Concretely, can we list, please, each step (init.d, service, etc...) responsible to the sync time process during the Raspbian start ?
I will be nice for me ;) !
-
@joecool said in Date/Time synchronization:
My problem is to know how this sync works.
Via NTP (either using
ntpd
orsystemd-timesyncd
, both speak the same protocol). I don't have a PI at hand to check, but I think you can check the list ofsystemd
running services and see ifntpd
is enabled. -
@mitu yep, only systemd-timesyncd.service is enabled...
Could I say to my new service to wait for the launch of systemd-timesyncd.service ? -
@joecool said in Date/Time synchronization:
Could I say to my new service to wait for the launch of systemd-timesyncd.service ?
Yes.
-
@mitu Add "After=systemd-timesyncd.service" (in the [Unit] section) into my <blabla>.service file, right ?
I will try now... -
@joecool said in Date/Time synchronization:
@mitu Add "After=systemd-timesyncd.service" (in the [Unit] section) into my <blabla>.service file, right ?
I will try now...It does not seem to work (with After=...). I tried with systemd-timesyncd.service, time-sync.target and sysinit.targetbut no one works... Strange !!
The time is always the last known... that at the moment of the shutdown.
I continue to search... If you have any idea, will be cool.
-
Instead of strictly depending on the timesyncd service, try making your service depending on the
network
target , otherwise the time service doesn't have a chance to do any synchronisation. Add a delay before the service starts using theExecStartPre
to runsleep
for 2-3 seconds. -
@mitu said in Date/Time synchronization:
epending on the timesyncd service
Good idea, I'm going to try that. Thanks.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.