LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-31-2013, 02:07 PM   #1
tb75252
Member
 
Registered: Oct 2010
Posts: 167

Rep: Reputation: Disabled
System Clock Always Off!


I have installed Slackware 14.1 (64-bit) on a desktop that has an Intel DQ965GF motherboard.

The BIOS does not have a UTC setting for the hardware clock, so I was extra careful to select "Hardware clock is set to local time" while installing Slackware. I also made sure to select the correct time zone where I live.

And yet, every time that I boot up the system clock is off by +6 hours!

I am not much of a Linux expert and hope that somebody on this forum will offer some guidance towards solving this annoyance.

Thanks.
 
Old 12-31-2013, 03:33 PM   #2
/dev/random
Member
 
Registered: Aug 2012
Location: Ontario, Canada
Distribution: Slackware 14.2, LFS-current, NetBSD 6.1.3, OpenIndiana
Posts: 319

Rep: Reputation: 112Reputation: 112
Is the BIOS battery low or dead?
Is this computer connected to the internet? if so just use NTP to correct the time.
 
Old 12-31-2013, 03:46 PM   #3
tb75252
Member
 
Registered: Oct 2010
Posts: 167

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by /dev/random View Post
Is the BIOS battery low or dead?
Is this computer connected to the internet? if so just use NTP to correct the time.
Battery is good and the desktop is connected to the Internet.

KDE control module has a check mark in the box "Set date and time automatically" and the time server selected is pool.ntp.org, if that's what you are talking about.
 
Old 12-31-2013, 04:52 PM   #4
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Does the output of 'date' coincide with the KDE time ?
 
Old 12-31-2013, 04:55 PM   #5
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
Known problem.

If you run ntpd on recent kernels your system (BIOS) clock will be reset to UTC even though the options are turned off in the kernel config.

The only real fix is to patch the kernel config directly and then recompile it.

See patch here :-
http://www.linuxquestions.org/questi...ml#post5039950
 
Old 12-31-2013, 04:57 PM   #6
tb75252
Member
 
Registered: Oct 2010
Posts: 167

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by metaschima View Post
Does the output of 'date' coincide with the KDE time ?
Yes it does. The weird thing now is that the system clock shows 04:56 AM of January 01, 2014, even though here is still 04:56 PM of December 31, 2013. So right now, the system clock is 12 hours ahead! When I originally posted the system clock was 6 hours ahead...
 
Old 12-31-2013, 05:01 PM   #7
tb75252
Member
 
Registered: Oct 2010
Posts: 167

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by wildwizard View Post
Known problem.

If you run ntpd on recent kernels your system (BIOS) clock will be reset to UTC even though the options are turned off in the kernel config.

The only real fix is to patch the kernel config directly and then recompile it.

See patch here :-
http://www.linuxquestions.org/questi...ml#post5039950
Wow, patch and recompile a kernel? That looks a little bit too complicated for a newbie like me! I might just have to put up with a system clock that is off...
 
Old 12-31-2013, 05:03 PM   #8
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
Until you try to use SSL and it fails as the clock is too far out.

Though you haven't stated if you are or are not running ntpd.

If you are running it what does ntpq tell you about the clock and sync.
 
Old 12-31-2013, 07:30 PM   #9
regis_n_bits
Member
 
Registered: Mar 2006
Distribution: Slackware64-15.0
Posts: 103

Rep: Reputation: Disabled
Are there any other OSes installed on that box?

If not, why not just set the hardware clock to UTC (using the 'timeconfig' utility).
 
Old 01-01-2014, 12:20 AM   #10
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 910

Rep: Reputation: 174Reputation: 174
As root, what is the output of ...

Code:
# hwclock --debug ; date
 
Old 01-01-2014, 11:12 AM   #11
Paulo2
Member
 
Registered: Aug 2012
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 926

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
I was having this problem too, even with rc.ntpd marked as executable and all KDE configurations right.

My solution was put this on rc.local
Code:
if ntpdate 200.20.186.75; then
  # set hardware clock
  hwclock -w
  echo -e "$(date)\n"
fi
That server is for Brazil BRST -3:00 (now is -2:00 since we are in daylight saving time),
I don't know if will work for every country.
 
Old 01-01-2014, 11:45 AM   #12
Soderlund
Member
 
Registered: Aug 2012
Posts: 185

Rep: Reputation: 81
Quote:
Originally Posted by Paulo2 View Post
I was having this problem too, even with rc.ntpd marked as executable and all KDE configurations right.

My solution was put this on rc.local
Code:
if ntpdate 200.20.186.75; then
  # set hardware clock
  hwclock -w
  echo -e "$(date)\n"
fi
That server is for Brazil BRST -3:00 (now is -2:00 since we are in daylight saving time),
I don't know if will work for every country.
Have you tried to just set the date to the correct time, and then running hwclock -w? Merely setting date does not solve it, then it will go away on the next reboot like you are experiencing. You need to run hwclock -w after setting the date.

You can also get odd time problems if you multiboot and one of the distributions uses local time while the other uses UTC. If that is the case, set both to the same time.

By the way, I have an old computer that thought it was 1997 when I started it (it was 2013). Bad battery.
 
Old 01-01-2014, 12:12 PM   #13
Paulo2
Member
 
Registered: Aug 2012
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 926

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
Quote:
Originally Posted by Soderlund View Post
Have you tried to just set the date to the correct time, and then running hwclock -w? Merely setting date does not solve it, then it will go away on the next reboot like you are experiencing. You need to run hwclock -w after setting the date.

You can also get odd time problems if you multiboot and one of the distributions uses local time while the other uses UTC. If that is the case, set both to the same time.

By the way, I have an old computer that thought it was 1997 when I started it (it was 2013). Bad battery.
Thanks for reply
I have dual boot whit Slackware and XP, I have to admit that I didn't boot XP to see
if the date was right there. I didn't boot XP before the problem too, so it isn't the cause.

The command "ntpdate" retrieves time from server and writes to system clock.
"hwclock -w" writes it to the hw clock, like you said.

So far that solution worked for me, this is because I didn't investigate
the original problem with more details.
Maybe something wrong with ntpd or KDE settings, or with my hardware
aside battery, I changed it when the problem started.

Last edited by Paulo2; 01-01-2014 at 12:21 PM. Reason: add some info
 
Old 01-03-2014, 07:19 AM   #14
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Two things you may want to do:
  • Boot XP and get into Control Panel.
  • Open Date & Time.
  • Make sure your time zone is correct (click the Time Zone tab) and remove the check from the automatically adjust clock for daylight savings. This will prevent XP from slewing the clock when you boot it after a daylight time change (Windows does that sort of thing, this is how you stop it).
  • Shut down XP and boot Slackware.
  • As root, edit /etc/ntp.conf; make your server list look like this:
Code:
#
# NTP server (list one or more) to synchronize with:
#server pool.ntp.org iburst
server 0.us.pool.ntp.org
server 1.us.pool.ntp.org
server 2.us.pool.ntp.org
If you're not in the US, use the two-character code for your country.

Understand that your hardware clock and your system clock are two separate things; the hardware clock (on your motherboard) is an actual clock chip similar to your wristwatch, it's run by a battery. The system clock is software, run by interrupts in the kernel.

You want to use NTP to keep the system clock on-time. You want to use three pool servers so NTP can evaluate which of those servers is the "best" (meaning the delay, offset and jitter are the lowest available). NTP will switch between servers, selecting the best one, it will also throw out one or more periodically and select a new server if one or more become unavailable, noisy, or poor choices -- it does this without any input from you. Also, if your Internet connection goes away for a while it will synchronize to your local host until the connection comes back and resynchronize to one of the pool servers stepping the system clock back into the correct time.

Now, if NTP was running, stop it with
Code:
/etc/rc.d/rc.ntpd stop
<wait a minute or so>
/etc/rc.d/rc.ntpd start
The daemon should be running and you can exeucte
Code:
/usr/sbin/ntpq -pn
to see a display like this after about five minutes or so:
Code:
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 127.127.1.0     .LOCL.          10 l   6d   64    0    0.000    0.000   0.000
+64.6.144.6      128.252.19.1     2 u  277 1024   37  629.042  -32.024  42.382
*216.37.64.3     132.163.4.102    2 u  401 1024  377  608.801  -27.456  38.502
+18.85.44.59     18.85.44.61      3 u  555 1024  377  614.653  -22.534  29.600
The plus sign indicates the server you're synchronized with, the asterisks indicate candidate servers, ones that may be used if the synchronized server goes away, becomes noisy or whatever makes it unsuitable.

This all supposes that your time zone is correct when NTP started. Note that /etc/rc.d/rc.ntpd has an argument that will do large correction to the system clock at boot time (at boot, time is read and initially set from the hardware clock, at shutdown, time is saved from the system clock to the hardware clock). Don't monkey with that.

There is no reason, if you turn off XP's daylight time adjustment as above to not have your hardware clock at UTC (all my servers are UTC and I have absolutely no problems with NTP keeping things on-time).

As others have described above, you can set your hardware clock from your system clock (you could also set it to the correct time UTC in the BIOS if your want to fiddle with that). Just make sure that you have the time configuration set (you may want to run [I]timeconfig/I], choosing UTC and your local time zone in console (without KDE running) or you could choose to set both clock to local time. Either way, NTP will keep your clocks synchronized. Don't monkey with time settings in KDE, it should default to what your system configuration settings are.

You may -- may! -- need to shut down, boot into BIOS and set that clock to close-to-correct wall or UTC time then boot to run level three (console, not KDE) to do these things. If you choose UTC, remember that EST in the US is UTC+5 or whatever your time zone is (it's 0812 EST, 1312 UTC right now here). If you've fiddled with settings in KDE, unfiddle 'em and let the system do its thing for you.

Hope this helps some.

Last edited by tronayne; 01-03-2014 at 07:21 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Clock on wrong time (system clock is set to UTC) yanom Debian 6 07-26-2011 11:26 AM
Why system clock runs faster than hardware clock? DavidLiu Linux - Software 2 01-23-2011 07:38 AM
Failed to set system clock to hardware clock jrtayloriv Linux - Newbie 2 09-25-2008 07:06 AM
Slow system clock and stray hardware clock, pleas help! Epox Linux - General 6 01-02-2007 02:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration