Author Topic: Clock not keeping correct time between reboots  (Read 4661 times)

Offline Galaxar

  • Full Member
  • ***
  • Posts: 121
Clock not keeping correct time between reboots
« on: April 16, 2010, 04:48:14 PM »
My clock is not keeping the correct time between reboots.  It always falls back 5 hours.  I'm using NTP and I followed Old Polack's instructions to the letter and still the same problem.  I noticed that during shutdown, I get the following message:  Syncing hardware clock to system time select() to /dev/rtc to wait for clock tick timed out [failed].  I noticed that someone had the same problem with beta 1 but I don't think it was addressed after that.  If it was, I missed it and apologize.  I'm using PCLOS 2010 Final, fully updated with the 2.6.32.11-pclos2 kernel.  I have a Toshiba Satellite L505D-S5983.  I do not have Windows on the drive, only PCLOS.  I can only use ACPI=ht, otherwise if I try to use full ACPI, it locks up at startup.  Any help would be greatly appreciated.  If you need any more info, I'd be glad to give it.  Thanks!

Galaxar

Online thorper

  • Hero Member
  • *****
  • Posts: 851
  • Linux Counter #490490
Re: Clock not keeping correct time between reboots
« Reply #1 on: April 16, 2010, 05:02:42 PM »
Have you checked your CMOS battery?
Too many cops, too few donuts.

Offline Galaxar

  • Full Member
  • ***
  • Posts: 121
Re: Clock not keeping correct time between reboots
« Reply #2 on: April 16, 2010, 05:07:26 PM »
I'm pretty sure that isn't it.  the bios keeps correct time.  just pclos reports the time 5 hours slow.  Besides, I got the laptop back in late October of last year.

Galaxar

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6380
  • I'm going South
Re: Clock not keeping correct time between reboots
« Reply #3 on: April 16, 2010, 06:55:24 PM »
Is your hardware clock set to UTC (GMT) or local time? (If you're just running Linux you should probably set it to UTC; those who sometimes also boot to Windows are almost forced to set it to local time.)

The hardware clock is read at boot to set the system clock. After that it isn't normally used, but it can be synchronized to system time at shutdown, or at regular intervals -- or not at all. Your error message seems to indicate that your hardware clock is set to sync at shutdown, and fails, which means that at your next boot it will again be off with the same amount as last time.

But before we start guessing why the synchronization doesn't succeed, it might be important to know whether the hardware clock and the system clock are set to the same time zone. (If you look at the file /etc/sysconfig/clock, do you see the line UTC=true or the line UTC=false? And is ZONE set correctly?)
« Last Edit: April 17, 2010, 10:21:24 AM by blackbird »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Galaxar

  • Full Member
  • ***
  • Posts: 121
Re: Clock not keeping correct time between reboots
« Reply #4 on: April 16, 2010, 07:33:47 PM »
well, right now it's set to false, but I've toyed around with true or false on that and never made a difference.  the time zone is correct.

Offline txm0523

  • Full Member
  • ***
  • Posts: 94
Re: Clock not keeping correct time between reboots
« Reply #5 on: April 16, 2010, 09:14:43 PM »
I was having the same problem too. I live in the USA in Central Time zone. What I did to solve the problem was to go into PCLOS Control Center, go to System, Manage System Services, scroll down till you find ntpd, put a check mark in the box next to On Boot and then click Start. After you close out of that window, then go to Set Date and Time, then put a check mark into the box titled Enable Network Time Protocol and then select the correct server, then set the correct time and the correct time zone, then click Ok. Close out of that window and then reboot. This seemed to correct the problem for me and I have not experienced it since ( knock on wood ). I have been using the PCLOS 2010 beta version and have been updating it through Synaptic. Maybe I should re-install with the final version.

Hope this helps.

Home Built PC: MOBO MSI 785GTM-E45, HDD West Dig 500 gb, Video Card AMD-ATI Radeon HD4200, Sound Card Radeon HD4200 Series RS880, Web Cam Creative Tech VF0415 Live Cam Vid IM ultra, Processor AMD Phenom 9750 Quad Core 2.4, RAM 4 GB PNY DDR2, Monitor Samsung S22B310

Offline Galaxar

  • Full Member
  • ***
  • Posts: 121
Re: Clock not keeping correct time between reboots
« Reply #6 on: April 16, 2010, 09:44:44 PM »
Thanks for the advice, but no go.  it was already set to boot at startup. and I'm already using ntp.  but thanks for trying.


Galaxar

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6380
  • I'm going South
Re: Clock not keeping correct time between reboots
« Reply #7 on: April 17, 2010, 04:23:42 AM »
I googled for your error message and got 1460 hits, so you're not alone with your problem.

Glancing through a few of them gave me the impression that one common reason for it is that on some systems the hwclock command needs the option --directisa.

I suppose you could simply try adding it to the line
Code: [Select]
[ -x /sbin/hwclock ] && action "Syncing hardware clock to system time" /sbin/hwclock --systohcin /etc/rc.d/init.d/halt, but a more general and less radical solution seems to be adding the line
Code: [Select]
CLOCKFLAGS=--directisato /etc/sysconfig/clock.

Whether it could work on PCLinuxOS and on your box I do not know, but it might be worth testing. It may also be irrelevant: I don't know much about hardware clocks and 1460 hits are a bit too many to study in depth.


Edit:

The man page for hwclock has this to say about the option:
Quote
--directisa
    is meaningful only on an ISA machine or an Alpha (which implements enough
    of ISA to be, roughly speaking, an ISA machine for hwclock's purposes).
    For other  machines,  it  has  no  effect.   This option tells hwclock to use
    explicit I/O instructions to access the Hardware Clock.  Without this option,
    hwclock will try to use the /dev/rtc device (which it assumes to be driven by
    the rtc device driver).  If it is unable to open the device  (for  read),
    it will use the explicit I/O instructions anyway.
« Last Edit: April 17, 2010, 05:14:41 AM by blackbird »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Ramchu

  • Hero Member
  • *****
  • Posts: 1589
Re: Clock not keeping correct time between reboots
« Reply #8 on: April 17, 2010, 06:17:47 AM »

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: Clock not keeping correct time between reboots
« Reply #9 on: April 17, 2010, 07:07:25 AM »
Thanks for the advice, but no go.  it was already set to boot at startup. and I'm already using ntp.  but thanks for trying.


Galaxar

Have you correctly set up locale in PCC?

Next is the "Manage Date & Time" .......  in there you need to ensure that the correct time zone is chosen, under the clock, and that on the left you have chosen a local NTP server.

I suspect you clock time zone is incorrect .....

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6380
  • I'm going South
Re: Clock not keeping correct time between reboots
« Reply #10 on: April 17, 2010, 07:16:24 AM »
I suspect you clock time zone is incorrect .....

That was my first suspicion too. But Galaxar wrote that his time zone is correct....

And the error message about the hardware clock not synchronizing to the software clock indicates a more serious problem.
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: Clock not keeping correct time between reboots
« Reply #11 on: April 17, 2010, 07:48:11 AM »
Maybe ntpd is not ticked to start in System Services?

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6380
  • I'm going South
Re: Clock not keeping correct time between reboots
« Reply #12 on: April 17, 2010, 08:06:14 AM »
Maybe ntpd is not ticked to start in System Services?


That's possible of course, but it wouldn't really explain the problem: ntpd keeps the system clock synchronized to a time server, while in this case it appears to be the hardware clock that refuses to be synchronized to the system clock....
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Online luikki

  • Hero Member
  • *****
  • Posts: 1408
Re: Clock not keeping correct time between reboots
« Reply #13 on: April 17, 2010, 08:23:11 AM »

And the error message about the hardware clock not synchronizing to the software clock indicates a more serious problem.


i believe so. in my test machine with 2010 b2,  minime 2010 or 2010 final, though the software clock shows the correct time, my bios (yes, the battery is good) clock is always one hour behind (if i correct the time and save the settings they will change on next boot) and at login screen time is always one our fast...
if i try to adjust time and date settings automatically there is an error:
Unable to contact time server: Public Time Server (pool.ntp.org) or Unable to contact time server: europe.pool.ntp.org

so, in my profund ignorance, i believe that there is something wrong with pclinuxos 2010  dealing with clocks...
so more so that if i  throw in another hdd with a different linux flavour, set  the bios clock for the correct time it remains unchanged...

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6380
  • I'm going South
Re: Clock not keeping correct time between reboots
« Reply #14 on: April 17, 2010, 09:09:44 AM »
luikki,

I believe your problem is a different one from Galaxar's. And I don't think it's a PCLinuxOS problem.

I've long since stopped using the pool servers as I could never be certain that they weren't down -- and didn't even know which particular server something like europe.pool.ntp.org actually stood for at a particular time. I use four stratum two servers that I know are reliable instead. And my system clock is always synchronized to one of them.

But setting the hardware clock is another matter.

And, by the way, Ramchu's link is a good one, if a bit on the terse side.
« Last Edit: April 17, 2010, 09:16:34 AM by blackbird »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D