Author Topic: [Solved] Localtime vs hardware clock: How to prevent PCLOS from writing to CMOS?  (Read 2333 times)

Offline jtwdyp

  • Jr. Member
  • **
  • Posts: 31
=> And I, JtWdyP didst utter:
Quote
But I _was_ thinking that an NTP server could fix the Linux system (soft clock), even in the extreme case of the bios time/date being "years" out of sync... Your comment is making me wonder about that however. My reasoning was that since the Linux system clock is based on a single numeric value of the number of seconds elapsed since { err, ahhh I forget, is it when the guy from Bell Labs invented Unix, or when Linus wrote the first Linux kernel? (Don't look, my "CRS" is showing)} But anyway since it's just one numeric field I would think writing the correct value to it would fix the time date regardless of how far out of sync the bios clock that it had been initially set from was...

Now I'm just plain going to have to find time to test that theory.

But first I'll have to actually select an NTP server in the PCC Like Old Polack described... That is, I really haven't a clue how to do that without using the durned gui... {sigh}

OK so I just did some empirical testing of that theory. And I was wrong. (Actualy I don't know that NTP wouldn't work. But the boot-up doesn't get that far because when it checks the  "root" filesystem it reacts differently to the superblocks last write time being years ahead, and the forced fscking fails...) Ah well so much for bothering with NTP...

But the main thing is that I stopped the bios clock from being synced yo the system time... To me this is especially importang for rematered live "cd"s err make that live "dvd"s As when if I talk someone into letting me use one on their PC I don't think I should be messing with their bios clock... This is something that I don't think live cd's should ever do by default.

Thanks again!--


|    ^^^   ^^^
|    <o>   <o>      Joe (theWordy) Philbrook
|        ^               J(tWdy)P
|       ___         <<jtwdyp@ttlc.net>>
|
|      <sigh>

[/pre]


Offline kjpetrie

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3996
=> kjpetrie did say:
Quote
Synaptic is just a GUI front-end for apt-get.

So then (assuming there were updates available) If I did a:
Code: [Select]
su -c "apt-get update && synaptic" And then clicked on the "mark updates" button without bothering to click-on the "reload" button, Synaptic would find and mark the same updates as if I did click on the reload button?

Correct.
Quote
My reasoning was that since the Linux system clock is based on a single numeric value of the number of seconds elapsed since { err, ahhh I forget, is it when the guy from Bell Labs invented Unix, or when Linus wrote the first Linux kernel? (Don't look, my "CRS" is showing)}

The beginning of 1970. Almost all computers, including Windows and Macs use the same reference point, hence the Universal Time  Constant. Macs store it as a 64-bit number Whereas Win and *nix use 32-bit, but will have to change sometime before 2038.
« Last Edit: March 10, 2010, 04:09:29 PM by kjpetrie »
-----------
KJP
-----------------------------------------------------------
PClos64 RC1 on Intel D945GCLF2 motherboard (Atom 330), 2GB DDR2 RAM, Maxtor STM325031, HL-DT-ST DVDRAM GSA-H42N, Amilo LSL 3220T monitor. Also Acer 5810TG (with custom kernel) and Asus eeePC 2G surf

Offline arjaybe

  • Sr. Member
  • ****
  • Posts: 377
  • Green Comet
    • Green Comet
To recap:  You sometimes reset the CMOS clock for various purposes.  PCLinuxOS sets the clock when you shut down.  You don't like that.  You have the same problem with other OSes that you periodically install on this machine.  You don't like that, either.  You want to know how you can set PCLinuxOS to not set the clock when it shuts down.  By extension, you want all your other OSes to also refrain from setting the clock when they shut down.

Solution:  When required, set the CMOS clock when booting.

Or:  Make a cron job that sets the clock when you shut down.  (I don't know how to do that, but I'm sure someone does.-)

To prevent fsck problems, disable file system checks during boot.  (I'm pretty sure that's in fstab.)

I can't predict what timestamp-related problems might result.  You'd have to be sure that you used consistent clock settings when doing upgrades, for example.  If you can find a way to automate all this then you're a better man than I am, Gunga Din.-)

Offline jtwdyp

  • Jr. Member
  • **
  • Posts: 31
Thanks kjpetrie, for the confirmation about apt-get/symantic, and the clarification on when most computers think time began...


=> arjaybe didst say:
Quote
By extension, you want all your other OSes to also refrain from setting the clock when they shut down.

Yup, And I usually succeed. But the method varies from distro t distro and possibly sometimes depending on which release within a distro...

Of my other installed Linux the only one I haven't stopped from messing with my bios clock on shutdown is Elive, And that's only cause I haven't found the time to address the issue there yet...

Finding time to get a grip on PCLOS's habit of doing that became a priority because I wanted to make some remastered live"cd" iso images that when booted from the liveDVD's they fit on wouldn't mess with the time on other peoples hardware. It's hard to tell someone that it won't automatically change ANYTHING on their PC when I know it will write to their bios clock... But That aspect (and original reason for this thread) was solved (see prev replies) by commenting out a single line in the halt script. Which method may well work on elive, (I'll have to peak at it's halt script and see ;) ;) )

=> arjaybe didst say:
Quote
Solution:  When required, set the CMOS clock when booting.  Or:  Make a cron job that sets the clock when you shut down.  (I don't know how to do that, but I'm sure someone does.-)

You mean something that recorded it's value at startup, adjusted that value for the duration PCLOS was running, and then somehow manages to write that adjusted time to CMOS between the moment when the halt script would save the system time in CMOS, and the actual powerdown or warm boot occurs???? I don't know who might know how to do that, but aside from wanting to learn from them, I think it's much easier to just prevent halt from messing with the CMOS clock in the first place. :) :)

=> arjaybe didst say:
Quote
To prevent fsck problems, disable file system checks during boot.  (I'm pretty sure that's in fstab.)

Too dangerous!


=> arjaybe didst say:
Quote
I can't predict what timestamp-related problems might result.  You'd have to be sure that you used consistent clock settings when doing upgrades, for example.  If you can find a way to automate all this then you're a better man than I am, Gunga Din.-)

Trust me, I'm so NOT! { that good }

--
|   ---   ___
|   <0>   <->     Joe (theWordy) Philbrook
|       ^              J(tWdy)P
|    ~\___/~      <<jtwdyp@ttlc.net>>



Offline arjaybe

  • Sr. Member
  • ****
  • Posts: 377
  • Green Comet
    • Green Comet
I'm glad you've got your solution.  What I meant with the cron job was just setting the clock to whatever time you set your CMOS to when you do that.  I wasn't thinking of the remaster-on-someone-else's-computer problem.  You figured out the simplest fix for that.  (I think live CDs shouldn't affect the computer's clock in the first place.  It belies any reassurances we might make about it "not touching your machine.")

cheers