Why is clock always wrong at boot?

Please post suggestions for improvement of Cinnamon on:
https://github.com/linuxmint/Cinnamon
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
fonestar

Why is clock always wrong at boot?

Post by fonestar »

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....
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
kurotsugi

Re: Why is clock always wrong at boot?

Post by kurotsugi »

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 23
Level 23
Posts: 18173
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Why is clock always wrong at boot?

Post by karlchen »

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
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 762 days now.
Lifeline
fonestar

Re: Why is clock always wrong at boot?

Post by fonestar »

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

Re: Why is clock always wrong at boot?

Post by kurotsugi »

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 23
Level 23
Posts: 18173
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Why is clock always wrong at boot?

Post by karlchen »

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
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 762 days now.
Lifeline
kurotsugi

Re: Why is clock always wrong at boot?

Post by kurotsugi »

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

Re: Why is clock always wrong at boot?

Post by fonestar »

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 23
Level 23
Posts: 18173
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Why is clock always wrong at boot?

Post by karlchen »

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
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 762 days now.
Lifeline
User avatar
karlchen
Level 23
Level 23
Posts: 18173
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Why is clock always wrong at boot?

Post by karlchen »

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
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 762 days now.
Lifeline
Locked

Return to “Cinnamon”