helloSystem / Utilities

Utilities written in PyQt5, meant for use with helloSystem
BSD 2-Clause "Simplified" License
28 stars 29 forks source link

Time wrong even though timezone is set correctly #37

Open grahamperrin opened 3 years ago

grahamperrin commented 3 years ago

Need a GUI to set/correct the time, which I have never seen correct, for example:

image

probonopd commented 3 years ago

Attach a UK Raspberry Pi keyboard and it will magically be correct at next boot :)

But yes, is needed.

grahamperrin commented 3 years ago

0.4.0 (0D9)

Date and time wrong on physical hardware (Ergo Vista 631). Not correct after making its usual wired network connection.

PS now I see, there's a network connection but https://github.com/helloSystem/Menu/issues/23#issuecomment-765797558 no Internet service.

After restarting the computer to gain Internet service: still, the date and time are wrong.

probonopd commented 3 years ago

Not correct after making its usual wired network connection.

Can you please retry in installed mode with the network present duing boot? Did you set the checkbox to automatically set the timezone during installation?

(But yes, we need a Preferences application for setting the timezone retroactievly, and getting the network time, and to set it manually.)

grahamperrin commented 3 years ago

Can you please retry in installed mode with the network present duing boot?

Not this weekend, sorry (I forgot to bring home, from work, the mobile hard disk drive where I store my VirtualBox data).

Did you set the checkbox to automatically set the timezone during installation?

I normally do so, the answer was probably "Yes".

grahamperrin commented 3 years ago

https://github.com/helloSystem/Utilities/issues/37#issuecomment-765795671

… physical hardware (Ergo Vista 631). Not correct after making its usual wired network connection. …

That was with an old Belkin router that's fed by my ISP's router.

0.4.0 (0D25)

The same problem with an HP EliteBook 8570p wired directly to my ISP's router.

Huawei, provided by TalkTalk:

Product type: HG633 Hardware version: H.1.01 Software version: v2.00t

grahamperrin commented 3 years ago

https://github.com/helloSystem/Utilities/issues/37#issuecomment-766193421

Can you please retry in installed mode with the network present duing boot?

0.4.0 (OD26)

Done.

Did you set the checkbox to automatically set the timezone during installation?

Yes:

2021-02-04 19:48:06

2021-02-04 19:49:40

jimmyface commented 3 years ago

The issue is incorrect timezone. It seems to be resetting the timezone to America/New_York on reboot, even if you manually change /etc/localtime to be your local timezone. I haven't been able to track down exactly which component is overwriting my changes to /etc/localtime on reboot

probonopd commented 3 years ago

Possibly

https://github.com/helloSystem/ISO/blob/6c18ab8c7474750b43847e9345eccd492a10a1f3/overlays/uzip/localize/files/usr/local/sbin/localize#L68

probonopd commented 3 years ago

Note to future self:

/etc/localtime seems to be one of those byzantine overengineered things. Instead of a simple config file saying timezone='Europe/Berlin' the file is in binary format...

To find out the timezone specified in /etc/localtime one can run

POSIXTZ=$(tail -n1 /etc/localtime)
echo $POSIXTZ
# CET-1CEST,M3.5.0,M10.5.0/3

TZNAME=$(find /usr/share/zoneinfo | while read fname; do cmp -s /etc/localtime "$fname" && echo "$fname" | cut -c 21- ; done)
echo $TZNAME
# Europe/Berlin
probonopd commented 3 years ago

Now that we have summer time (DST) the clock is wrong on a freshly installed 13.0 based system (build 0E105 for commit ee5f30b) even though Europe/Berlin is correct. Something is definitely not working as it should...

probonopd commented 3 years ago

On a machine with an installed system where it is wrong:

FreeBSD% POSIXTZ=$(tail -n1 /etc/localtime)
echo $POSIXTZ
TZNAME=$(find /usr/share/zoneinfo | while read fname; do cmp -s /etc/localtime "$fname" && echo "$fname" | cut -c 21- ; done)
echo $TZNAME

CET-1CEST,M3.5.0,M10.5.0/3
Europe/Berlin

FreeBSD% uname -v
FreeBSD 12.1-RELEASE r354233 GENERIC 

FreeBSD% cat /.url 
https://github.com/helloSystem/ISO/commit/1e8d54e

The system shows two hours later than it actually is. Why?

Probably because ntpdate did not run properly at boot time?

FreeBSD% sudo /etc/rc.d/ntpdate onestart
Setting date via ntp.
 2 Apr 17:44:53 ntpdate[2207]: step time server 129.250.35.250 offset -7200.834731 sec

solves it, now the time is correct.

Turns out that despite

https://github.com/helloSystem/ISO/blob/1e8d54ee6f7124943869c2322e92c9d77414f503/settings/rc.conf.common#L20

/etc/rc.conf on the installed system is missing ntpdate_enable="YES":

FreeBSD% cat /etc/rc.conf
zfs_enable="YES"
slim_enable="YES"
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
linux_enable="YES"
dbus_enable="YES"
kld_list="cuse ig4 iicbus iichid utouch asmc"
allscreens_kbdflags="-b quiet.off"
ifconfig_em0="DHCP"
ifconfig_em0_ipv6="inet6 accept_rtadv"
cupsd_enable="YES"
initgfx_enable="YES"
initgfx_menu="NO"
hostname="FreeBSD"
sshd_enable="YES"
probonopd commented 3 years ago

localize seems to overwrite the timezone determined by the Install FreeBSD application, e.g., when the user selects English (US) it uses America/New_York despite the user being in Pacific/Auckland, resulting in (among other things) wrong circadian color temperatures of the screen. We need to think about a better way to do /usr/local/sbin/localize. cc @bmentink

bmentink commented 3 years ago

Thanks for the confirmation of that issue.

kettle-7 commented 3 years ago

/etc/localtime seems to be one of those byzantine overengineered things.

It should be a symbolic link.

grahamperrin commented 2 years ago

Gentle bump, this is a horrible bug. The clock is permanently wrong, hours off :-(

probonopd commented 2 years ago

Depends on:

grahamperrin commented 1 year ago

https://github.com/helloSystem/Utilities/issues/37#issue-792664626

Need a GUI to set/correct the time, …

Related: