LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 11-17-2013, 07:32 PM   #1
GiveMeSomeSlackware
LQ Newbie
 
Registered: Oct 2012
Location: United States of America
Distribution: Slackware
Posts: 13

Rep: Reputation: Disabled
Time never syncs right


I am trying to sync with the US time server. Every time I do, it will result in a time that is way off. If it's 7 PM, it would be set to 1 AM of the next day.
 
Old 11-17-2013, 07:37 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 1,999

Rep: Reputation: Disabled
Tour time zone settings are probably incorrect. What does date say about your time zone? If it doesn't match your physical location, run timeconfig to select a different time zone.

Are you using ntpd to synchronize the clock? Which time server(s) are you using?
 
1 members found this post helpful.
Old 11-17-2013, 08:56 PM   #3
frankbell
Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Mageia, Mint
Posts: 7,959

Rep: Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505
Linux systems are commonly set to UTC (Greenwich Mean) time and use the timezone setting to convert that to local time for display purposes. In general, servers are commonly set to UTC time for world-wide time compatibility and Linux is descended from serverland.

This article will tell you more about how time works on Slackware.

It took me quite a while (like years), but I finally figured out to my own satisfaction how to set time in a way that works for me. The only effective way to do it thoroughly is as root, from the command line.

I will use the date command to set the time I desire, then the hwclock (hardwareclock) command to set the hardware clock to the system time.

Code:
date -s [time string]   <-------set time
hwclock -w   <-------set hardware clock to system time

Last edited by frankbell; 11-17-2013 at 08:59 PM.
 
Old 11-17-2013, 09:43 PM   #4
GiveMeSomeSlackware
LQ Newbie
 
Registered: Oct 2012
Location: United States of America
Distribution: Slackware
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Ser Olmy View Post
Tour time zone settings are probably incorrect. What does date say about your time zone? If it doesn't match your physical location, run timeconfig to select a different time zone.

Are you using ntpd to synchronize the clock? Which time server(s) are you using?
I had before reading this, i had to manually reset it. Now doing...

Code:
# date
...in console as a normal user gives me the right time.

Yes, I am using ntpd. The server is, us.pool.ntp.org. Still though it never works right.

In case if this matters, I generally set my hardware clock to localtime, not UTC.

EDIT: From Sunday night to noon Friday, I am unable to access such servers (and several other servers/websites) for some weird reason.

Last edited by GiveMeSomeSlackware; 11-17-2013 at 09:51 PM.
 
Old 11-17-2013, 11:37 PM   #5
StreamThreader
Member
 
Registered: Mar 2012
Location: Ukraine/Odesa
Distribution: Slackware
Posts: 85

Rep: Reputation: 6
Same problem, in 14.1 have some problem with time.
 
Old 11-18-2013, 01:04 AM   #6
ttk
Member
 
Registered: May 2012
Location: Sebastopol, CA
Distribution: Slackware
Posts: 203
Blog Entries: 13

Rep: Reputation: 128Reputation: 128
About a decade ago I got tired of dorking around with ntp's capriciousness and wrote a little script:

http://ciar.org/ttk/public/rsetdate

It gets the clock close enough for personal use (within a second), so I just stick it in /etc/cron.daily and forget about it. It's not a good solution, just a convenient one.
 
Old 11-18-2013, 03:07 AM   #7
phi11ip
Member
 
Registered: Jul 2007
Location: Nottingham, UK
Distribution: Slackware64-current
Posts: 52

Rep: Reputation: 14
Are you using KDE as your desktop environment? If so you need to set the correct timezone in KDE as well. Right click on the digital clock in the task bar then select "Adjust Date and Time"
 
Old 11-18-2013, 06:19 AM   #8
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 755

Rep: Reputation: 226Reputation: 226Reputation: 226
Have a read of this thread as it sounds like it might be the problem :-

http://www.linuxquestions.org/questi...me-4175477525/
 
Old 11-18-2013, 07:15 AM   #9
GiveMeSomeSlackware
LQ Newbie
 
Registered: Oct 2012
Location: United States of America
Distribution: Slackware
Posts: 13

Original Poster
Rep: Reputation: Disabled
the settings in kde are correct to. I still don't get why I am having so many problems with it.

Last edited by GiveMeSomeSlackware; 11-18-2013 at 07:16 AM.
 
Old 11-18-2013, 07:33 AM   #10
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 1,999

Rep: Reputation: Disabled
Quote:
Originally Posted by GiveMeSomeSlackware View Post
the settings in kde are correct to. I still don't get why I am having so many problems with it.
Could you post the following:
  1. your current time/date and timezone settings as reported by date
  2. the output from hwclock --show
  3. the output from zcat /proc/config.gz | grep CONFIG_RTC_[SH]
  4. the contents of /etc/ntp.conf (perhaps filtered through grep -v "^#.*" for brevity)
FWIW, I'm using ntpd on several Slackware systems with the hardware clock set to local time, and apart from some issues with the RTC options in recent kernels, I haven't had any problems at all.
 
Old 11-18-2013, 09:41 AM   #11
GiveMeSomeSlackware
LQ Newbie
 
Registered: Oct 2012
Location: United States of America
Distribution: Slackware
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Ser Olmy View Post
Could you post the following:
  1. your current time/date and timezone settings as reported by date
  2. the output from hwclock --show
  3. the output from zcat /proc/config.gz | grep CONFIG_RTC_[SH]
  4. the contents of /etc/ntp.conf (perhaps filtered through grep -v "^#.*" for brevity)
FWIW, I'm using ntpd on several Slackware systems with the hardware clock set to local time, and apart from some issues with the RTC options in recent kernels, I haven't had any problems at all.
bash-4.2# date
Mon Nov 18 09:40:29 CST 2013
bash-4.2# hwclock --show
Mon 18 Nov 2013 09:40:33 AM CST -0.626721 seconds
bash-4.2# zcat /proc/config.gz | grep CONFIG_RTC_[SH]
# CONFIG_RTC_HCTOSYS is not set
# CONFIG_RTC_SYSTOHC is not set
bash-4.2#


EDIT: I don't understand this "grep" thing. What does it do?

Last edited by GiveMeSomeSlackware; 11-18-2013 at 09:43 AM.
 
Old 11-18-2013, 09:48 AM   #12
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 1,999

Rep: Reputation: Disabled
Quote:
Originally Posted by GiveMeSomeSlackware View Post
bash-4.2# date
Mon Nov 18 09:40:29 CST 2013
bash-4.2# hwclock --show
Mon 18 Nov 2013 09:40:33 AM CST -0.626721 seconds
According to the official source, both your system and hardware clocks are showing the correct time for the CST time zone.
Quote:
Originally Posted by GiveMeSomeSlackware View Post
EDIT: I don't understand this "grep" thing. What does it do?
It just reads data from standard input (usually piped from some other program), and displays lines matching the search criteria (or lines not matching the search criteria, if you use the "-v" switch).

Last edited by Ser Olmy; 11-18-2013 at 09:49 AM.
 
1 members found this post helpful.
Old 11-19-2013, 05:46 PM   #13
NightSky
Member
 
Registered: Sep 2001
Location: Texas :(
Distribution: Slackware64-13.37
Posts: 776

Rep: Reputation: 50
My clock is off all the time too. right now I am 24 minutes too fast. I tried the steps found here are not helping. Anyone come up with a solution please do post here. Thanks
 
Old 11-19-2013, 06:09 PM   #14
GazL
Senior Member
 
Registered: May 2008
Posts: 3,447

Rep: Reputation: 975Reputation: 975Reputation: 975Reputation: 975Reputation: 975Reputation: 975Reputation: 975Reputation: 975
/etc/rc.d/rc.ntpd stop (if it's running)
timeconfig
ntpdate pool.ntp.org
hwclock --localtime --systohc or hwclock --utc --systohc (depending on what you chose in timeconfig)

/etc/rc.d/rc.ntpd start (if you want)

It's possible existing processes/daemons may still be using the old timezone, stop/start them or if in doubt reboot.
 
1 members found this post helpful.
Old 11-20-2013, 08:03 PM   #15
mlslk31
Member
 
Registered: Mar 2013
Location: Florida, USA
Distribution: Slackware, FreeBSD
Posts: 126

Rep: Reputation: 47
Quote:
Originally Posted by NightSky View Post
My clock is off all the time too. right now I am 24 minutes too fast. I tried the steps found here are not helping. Anyone come up with a solution please do post here. Thanks
There is no one solution. What is the output of `ntpq -p -c rv`? Should you launch ntpd with the -g flag (allow first adjustment to be large), does the time get set correctly and then drift later? More questions may follow.
 
  


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
LXer: Ubuntu syncs up with OpenStack LXer Syndicated Linux News 0 10-14-2013 03:20 PM
rsync re-syncs same files tripialos Linux - Newbie 3 03-04-2013 04:50 AM
rsync problem - syncs all files MarcusWebb1966 Linux - General 22 09-19-2012 05:58 AM
[SOLVED] display/montor (re)syncs on every screen switch cheesus Linux - Hardware 3 11-26-2007 04:13 PM
Palm PDA no longer syncs oneandoneis2 Linux - Hardware 2 03-28-2005 04:35 AM


All times are GMT -5. The time now is 12:09 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration