Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log timestamping - inconsistent timezones #498

Open
csylvain opened this issue Mar 23, 2021 · 5 comments
Open

log timestamping - inconsistent timezones #498

csylvain opened this issue Mar 23, 2021 · 5 comments

Comments

@csylvain
Copy link

the timestamps in the system log would start off in my local timezone (determined by lat:lon available to kiwisdr daemon?) and then slew to UTC after GPS acquisition on every reboot.

account 'root' and 'debian' on beagleboard report UTC timezone from command line.

during boot up, these lines appear in log:

Tue Mar 23 14:33:02 00:00:39.314 ....      TIMEZONE: lat/lon from admin public config: (39.599998, -78.900002)
Tue Mar 23 14:33:03 00:00:40.300 ....      IPINFO: public ip 98.219.234.52 from get.geojs.io
Tue Mar 23 14:33:03 00:00:40.303 ....      IPINFO: lat/lon = (39.649399, -78.930603) from get.geojs.io
Tue Mar 23 14:33:03 00:00:40.307 ....      task pub_NET:P2:T003(-) exited by returning
Tue Mar 23 14:33:04 00:00:41.242 ....      TIMEZONE: from timezonedb.com for (39.599998, -78.900002): utc_offset=-14400/-4.0 dst_offset=0/0.0
Tue Mar 23 14:33:04 00:00:41.248 ....      TIMEZONE: "EDT", "America\/New_York"
Tue Mar 23 14:33:04 00:00:41.250 ....      task get_TZ:P2:T004(-) exited by returning

i checked hwclock to verify RTC is set to UTC -- confirmed.
yet: the timedatectl configuration (systemd) reported RTC not set to local time (UTC in this case).

i have changed the following

sudo timedatectl set-local-rtc 1

timedatectl
      Local time: Tue 2021-03-23 15:39:19 UTC
  Universal time: Tue 2021-03-23 15:39:19 UTC
        RTC time: Tue 2021-03-23 15:39:19
       Time zone: Etc/UTC (UTC, +0000)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: yes

Warning: The system is configured to read the RTC time in the local time zone.
         This mode can not be fully supported. It will create various problems
         with time zone changes and daylight saving time adjustments. The RTC
         time is never updated, it relies on external facilities to maintain it.
         If at all possible, use RTC in UTC by calling
         'timedatectl set-local-rtc 0'.

now the entire system is in UTC and the RTC is configured for UTC local timezone.
upon reboot, the log now begins with a UTC timestamp (not my local time zone) and does no longer slew forward some many hours from my local time to UTC shortly after completing the system reboot and acquiring GPS.

@jks-prv
Copy link
Owner

jks-prv commented Mar 23, 2021

This is incorrect. The Kiwi code does not change the Linux/Debian timezone. It should always be UTC. As the Beagle does not have an RTC (real-time clock) driver currently I don't know what set-local-rtc does.

The Kiwi code does attempt to determine the timezone so it can show local time in the user interface in addition to UTC. It can only do this if it can determine the lat/lon. There are three ways of doing that: via GPS if it has a signal, from public ip address geo-location or, as a last resort, if the admin has entered a lat/lon on the admin page.

@csylvain
Copy link
Author

csylvain commented Mar 23, 2021 via email

@csylvain
Copy link
Author

csylvain commented Mar 23, 2021 via email

@csylvain
Copy link
Author

csylvain commented Mar 23, 2021 via email

@jks-prv
Copy link
Owner

jks-prv commented Mar 24, 2021

What are you talking about? Your log attachment does not show the UTC timestamps (first column) "slewing ahead" when the TZ is acquired. They are always in UTC. The Kiwi code never changes the Linux time or TZ when it acquires the TZ. It is only used for the display of local time in the Kiwi user interface.

The only possible issue is if you deliberately set the Linux TZ instead of leaving it UTC as shipped in the image from the factory. People who mess with Linux in this way get what they deserve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants