Why is clock always wrong at boot?

Please post suggestions for improvement of Cinnamon here
https://github.com/linuxmint/Cinnamon
Post Reply
fonestar
Level 1
Level 1
Posts: 32
Joined: Fri Jan 03, 2014 3:00 pm

Why is clock always wrong at boot?

Post by fonestar » Thu Dec 04, 2014 12:42 pm

My clock is always 8 hours ahead no matter what. I am running LM17 32 bit with Cinnamon. I have the 24hr clock option set. I have already chosen my proper timezone and UTC=no has already been set. My BIOS is right and none of my Linux Live CD distros seem to have a problem with this.

Any ideas? Very annoying to reset my clock with every boot....

kurotsugi
Level 6
Level 6
Posts: 1038
Joined: Fri Jan 25, 2013 3:54 am

Re: Why is clock always wrong at boot?

Post by kurotsugi » Thu Dec 04, 2014 1:55 pm

the correct way to do it is edit /etc/adjtime and replace UTC with LOCAL. the UTC=no tweak is no longer works.

User avatar
karlchen
Level 20
Level 20
Posts: 10704
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Why is clock always wrong at boot?

Post by karlchen » Thu Dec 04, 2014 2:12 pm

kurotsugi wrote:the correct way to do it is edit /etc/adjtime and replace UTC with LOCAL.
Does this not only apply to LMDE?
the UTC=no tweak is no longer works.
Telling from what I see on my Windows 7 / Ubuntu / Linux Mint dual and triple boot systems, I tend to conclude, it does exactly what it is supposed to do on Ubuntu up to 14.04.1 and on Linux Mint up to 17. :wink:
Image
Linux Mint 18.1 64-bit Cinnamon Desktop, Total Commander 9.22a 64-bit
Ubuntu 18.04.2 32-bit Mate Desktop, Total Commander 9.22a 32-bit
Windows? - 1 window in every room

fonestar
Level 1
Level 1
Posts: 32
Joined: Fri Jan 03, 2014 3:00 pm

Re: Why is clock always wrong at boot?

Post by fonestar » Thu Dec 04, 2014 2:16 pm

Hmm... okay thanks for the reply but I just "cat /etc/adjtime" and it is already set to LOCAL under some other lines. Any other ideas?

kurotsugi
Level 6
Level 6
Posts: 1038
Joined: Fri Jan 25, 2013 3:54 am

Re: Why is clock always wrong at boot?

Post by kurotsugi » Thu Dec 04, 2014 2:28 pm

ubuntu is based on debian so that the trick should work on both mint main version and lmde. to be precise, it should work on every linux. UTC=no no longer works because upstream changes on NTP. "it's debian" and "that's ubuntu" should not matter here :3

http://www.linuxquestions.org/questions ... me-907557/

here's some proof that UTC=no doesn't always work
https://bugs.launchpad.net/bugs/1377698
https://lists.launchpad.net/touch-packa ... 24103.html
http://osdir.com/ml/ubuntu-bugs/2014-08/msg06601.html

the root of the problem is surely NTP. it could be either broken or not properly calibrated. the linuxquestion above will give you hint about how to calibrate it but it might better to first check whether if NTP really work or not. first, you'll need to revert back to UTC and check the log messages about NTP.

User avatar
karlchen
Level 20
Level 20
Posts: 10704
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Why is clock always wrong at boot?

Post by karlchen » Thu Dec 04, 2014 2:47 pm

Hello, kurotsugi.

On workstation machines (desktop, notebook) I do not use ntpd at all, because the command ntpdate is sufficient. So whatever bug affects ntpd does not affect me at the moment.
A bug introduced by Ubuntu 14.10. I use LTS releases only: Ubuntu 12.04 + 14.04, Mint 13 + Mint 17. Therefore, they are not affected by any bug introduced by Ubuntu 14.10. (... unless the day comes when the buggy software should be backported to Ubuntu 14.04 without having been fixed beforehand ...)
Just a problem report, unconfirmed that the root cause is as stated.

There is simply one little detail which makes me believe that UTC=no still works:
On my Windows / Ubuntu / Linux Mint multi-boot systems, the displayed time is correct, no matter whether I boot to Windows 7, to Ubuntu or to Linux Mint. And in particular on Ubuntu / Linux Mint it is easy to find out whether ntpdate corrects the time by an hour or not (we are 1 hour ahead of UTC), because it logs its action in /var/log/syslog. And it never corrects the time by more than a few seconds.
Conclusion:
All 3 OSes agree that the hardware clock is on local time, which it is. And the only hint which Ubuntu / Linux Mint has got here is UTC=no.

But I will check the file /etc/adjtime. After all it is imaginable that Ubuntu has started migrating the setting from /etc/default/rcS to /etc/adjtime silently.

Cheers,
Karl
Last edited by karlchen on Fri Dec 05, 2014 12:55 pm, edited 1 time in total.
Reason: My bad mistake corrected: it is /etc/default/rcS, not /etc/rcS
Image
Linux Mint 18.1 64-bit Cinnamon Desktop, Total Commander 9.22a 64-bit
Ubuntu 18.04.2 32-bit Mate Desktop, Total Commander 9.22a 32-bit
Windows? - 1 window in every room

kurotsugi
Level 6
Level 6
Posts: 1038
Joined: Fri Jan 25, 2013 3:54 am

Re: Why is clock always wrong at boot?

Post by kurotsugi » Thu Dec 04, 2014 6:31 pm

fist of all, AFAIK the possible source of these problem is:
1. ntp is broken
2. you use dualboot with windows
3. you need to change your bios battery.

IIRC ntp is used on ubuntu and the old mint I used also have it (though honestly I forgot which version was it). I assume newest mint also have it which makes me suddenly jump into conclusion that ntp is broken. if mint doesn't use it then I'll gladly accept that I'm wrong. deeply sorry for the quick assumption. then, about rcS and UTC=no, in my understanding rcS is already obsolete and the UTC config have been moved into /etc/adjtime long time ago. arch, manjaro, debian, and other distro already follow it. in debian, it already happened in 2012 and debian currently doesn't have /etc/rcS anymore. I also use /etc/adjtime when I was on ubuntu/mint and it work as expected.
http://forums.debian.net/viewtopic.php?f=6&t=84138

Code: Select all

cat /etc/rcS
cat: /etc/rcS: No such file or directory


I believe it clearly explain why OP got this result
Hmm... okay thanks for the reply but I just "cat /etc/adjtime" and it is already set to LOCAL under some other lines

I'm not on ubuntu anymore and you should better informed about the situation on ubuntu, including whether if rcS still work or not. my quick decision also based on the fact OP already have UTC=no in rcS and LOCAL in /etc/adjtime but neither of this method work. thus, I conclude that rcS doesn't work in his system too. nevertheless, once again, you should be the one who more well informed about ubuntu. I think it should be wiser for me leave this matter to you. deeply sorry for my quick assumption. good luck :3

fonestar
Level 1
Level 1
Posts: 32
Joined: Fri Jan 03, 2014 3:00 pm

Re: Why is clock always wrong at boot?

Post by fonestar » Thu Dec 04, 2014 7:12 pm

Hi thanks for the replies, but again I do not dual-boot with Windows. My BIOS battery is fine, my Kali persistent USB stick has no problem with clock and my Knoppix Live CD has no problem with the clock. I tried setting the clock from 24hrs to 12hrs, rebooted and still the same problem. My settings are as have already been described above, UTC=no and LOCAL. So I have no idea what is going on.....

User avatar
karlchen
Level 20
Level 20
Posts: 10704
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Why is clock always wrong at boot?

Post by karlchen » Fri Dec 05, 2014 12:58 pm

Hello, kurotsugi.

Please, note: Corrected my bad mistake in my previous post: it is /etc/default/rcS, not /etc/rcS. So I made you search for rcS in the wrong folder. Sorry.

Cheers,
Karl
Image
Linux Mint 18.1 64-bit Cinnamon Desktop, Total Commander 9.22a 64-bit
Ubuntu 18.04.2 32-bit Mate Desktop, Total Commander 9.22a 32-bit
Windows? - 1 window in every room

User avatar
karlchen
Level 20
Level 20
Posts: 10704
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Why is clock always wrong at boot?

Post by karlchen » Fri Dec 05, 2014 1:02 pm

Hello, fonestar.

As you are not dual-booting with Windows, there should not be any need to change the Linux default to NO.
Means:
All Linux distros by default assume that the hardware clock has been set to UTC and display on the screen UTC + local time offset.
In case on a Linux dual boot system, 2 Linux distros involved, one uses UTC=yes and one uses UTC=no, you might see the behaviour that you see.
Live systems will use the Linux default which is UTC=yes, irrespective whether they all use the same config file to store the setting.
Might be worth checking.

The time display format 24 hour format vs. 12 hour format should be irrelevant to problem.

Cheers,
Karl
Image
Linux Mint 18.1 64-bit Cinnamon Desktop, Total Commander 9.22a 64-bit
Ubuntu 18.04.2 32-bit Mate Desktop, Total Commander 9.22a 32-bit
Windows? - 1 window in every room

Post Reply

Return to “Cinnamon”