Page 1 of 1

Pi initial Startup clock is messed up (Solved)

PostPosted: 13 Apr 2018, 11:41
by irishwill2008
Hi guys,

This isnt a major thing but always grabbed my curiosity.
First let me state that running:
Code: Select all
timedatectl status

I receive the correct timezone information.

I receive:
Code: Select all
 Local time: Fri 2018-04-13 11:33:50 IST
  Universal time: Fri 2018-04-13 10:33:50 UTC
        RTC time: n/a
       Time zone: Europe/Dublin (IST, +0100)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no


When the pi boots the times stamped on the services etc is like 2 years ago (Not using current time as if its not synced yet?).

Example, if i do a simple:
Code: Select all
systemctl status rune_PL_wrk


It states:
Code: Select all
Active: active (running) since Mon 2016-02-22 14:40:18 GMT; 2 years 1 months ago

All services started time stamps around then..?

Now if i restart a service or manually start one it timestamps to the current and correct time/date? It seems something for the clock setup is not running before these startup.

Would love your inputs.

Regards,

Will.

Re: Pi initial Startup clock is messed up.

PostPosted: 13 Apr 2018, 16:07
by hondagx35
Hi Will,

When the pi boots the times stamped on the services etc is like 2 years ago (Not using current time as if its not synced yet?).

Arch Linux uses "systemd" to start all the services.
"systemd" is able to start all the services in parallel, so you get very short boot times.
This has some drawback like the one you encountered.
"systemd" does not wait for "timesyncd" or "ntpd" to synchronize the time.
If this is vital for you, you can hack "systemd" to wait until your network is up and the time is synced.
I think there is no need for this.

Frank

Re: Pi initial Startup clock is messed up.

PostPosted: 13 Apr 2018, 20:23
by janui
Hi irishwill2008,

Personally, I agree with Frank. But if it really really irritates you, fake-hwclock could be a solution. See here for details: https://wiki.archlinux.org/index.php/time

...fake-hwclock
alarm-fake-hwclock designed especially for system without battery backed up RTC, it includes a systemd service which on shutdown saves the current time and on startup restores the saved time, thus avoiding strange time travel errors...
Install it with this:
Code: Select all
pacman -Sy fake-hwclock
janui

Re: Pi initial Startup clock is messed up.

PostPosted: 16 Apr 2018, 09:10
by irishwill2008
Hi guys,

Thanks for clearing that one up! Honestly, it doesnt effect me nor do i want to mess with the boot time etc just to allow times to show correctly on a service i will never be looking into but i always wanted to know why it was happening xD

I can sleep easy tonight so :D :lol:

At least thats covered for me and hopefully some other lost soul :)

Thanks!

Regards,

Will.