LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 03-29-2011, 09:15 AM   #1
mlpa
Member
 
Registered: May 2008
Location: Aveiro
Distribution: Slackware
Posts: 542

Rep: Reputation: 50
NTP problems in Slackware 13.1


Hi, I use Slackware64 13.1 and this Sunday the hour change and ntp daemon don't start automatically and my clock is an hour late.

It's normal or a bug?
 
Old 03-29-2011, 09:16 AM   #2
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
What version of glibc-zoneinfo do you have? Is your timezone set correctly?

Quote:
ntp daemon don't start automatically
Do you run ntp on a cron job or something?

Last edited by Richard Cranium; 03-29-2011 at 09:17 AM. Reason: Another question.
 
Old 03-29-2011, 09:22 AM   #3
mlpa
Member
 
Registered: May 2008
Location: Aveiro
Distribution: Slackware
Posts: 542

Original Poster
Rep: Reputation: 50
Quote:
Originally Posted by Richard Cranium View Post
What version of glibc-zoneinfo do you have? Is your timezone set correctly?



Do you run ntp on a cron job or something?
How can I check glibc-zoneinfo and timezone?

I have ntp running in rc.ntp.
 
Old 03-29-2011, 09:27 AM   #4
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,651

Rep: Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772
you have to update the /etc/ntp.conf with the correct NTP Server or else it won't get any updates at all
 
Old 03-29-2011, 09:30 AM   #5
mlpa
Member
 
Registered: May 2008
Location: Aveiro
Distribution: Slackware
Posts: 542

Original Poster
Rep: Reputation: 50
Quote:
Originally Posted by willysr View Post
you have to update the /etc/ntp.conf with the correct NTP Server or else it won't get any updates at all
Yes i have done that, I have the server from my University.
Until the change in hour was working well.
I ran ntpq -p and see connected to peers.
Now says
Code:
ntpq: read: Connection refused
 
Old 03-29-2011, 09:33 AM   #6
mlpa
Member
 
Registered: May 2008
Location: Aveiro
Distribution: Slackware
Posts: 542

Original Poster
Rep: Reputation: 50
My timezone is WEST and since I'm in Portugal I think is correct.
 
Old 03-29-2011, 09:35 AM   #7
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,357

Rep: Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739
To set your local time zone run, as root, 'timeconfig'.
To get ntp to run automatically, /etc/rc.d/rc.ntpd needs to be executable. Use 'ntpd -q' for one off time updates.

A properly configured ntp setup will handle daylight saving changes. Perhaps you could post your /etc/ntp.conf file.
 
Old 03-29-2011, 09:37 AM   #8
mlpa
Member
 
Registered: May 2008
Location: Aveiro
Distribution: Slackware
Posts: 542

Original Poster
Rep: Reputation: 50
My ntp.conf

Quote:
# Sample /etc/ntp.conf: Configuration file for ntpd.
#
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available. The
# default stratum is usually 3, but in this case we elect to use stratum
# 0. Since the server line does not have the prefer keyword, this driver
# is never used for synchronization, unless no other other
# synchronization source is available. In case the local host is
# controlled by some external source, such as an external oscillator or
# another protocol, the prefer keyword would cause the local host to
# disregard all other synchronization sources, unless the kernel
# modifications are in use and declare an unsynchronized condition.
#
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
#server pool.ntp.org

# Portugal NTP SERVER
server 3.pt.pool.ntp.org
server 3.europe.pool.ntp.org
server 2.europe.pool.ntp.org

# UA NTP SERVER
server 193.136.172.21
server 193.136.172.20

#
# Drift file. Put this in a directory which the daemon can write to.
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()'ing
# it to the file.
#
driftfile /etc/ntp/drift
multicastclient # listen on default 224.0.1.1
broadcastdelay 0.008

#
# Keys file. If you want to diddle your server at run time, make a
# keys file (mode 600 for sure) and define the key number to be
# used for making requests.
# PLEASE DO NOT USE THE DEFAULT VALUES HERE. Pick your own, or remote
# systems might be able to reset your clock at will.
#
#keys /etc/ntp/keys
#trustedkey 65535
#requestkey 65535
#controlkey 65535

# Don't serve time or stats to anyone else by default (more secure)
restrict default noquery nomodify
# Trust ourselves. :-)
restrict 127.0.0.1
 
Old 03-29-2011, 09:37 AM   #9
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by mlpa View Post
How can I check glibc-zoneinfo and timezone?

I have ntp running in rc.ntp.
For glibc-zoneinfo, try
Code:
ls /var/log/packages/glibc-zoneinfo*
For the timezone, try
Code:
strings /etc/localtime | tail -1l
(Or just run /usr/sbin/timeconfig as root)

willysr brought up a good point about configuring ntpd. Here's what my configuration (/etc/ntp.conf) looks like:

Code:
restrict default notrust nomodify noquery
restrict 172.16.0.0 mask 255.255.255.0 nomodify
fudge 127.127.1.0 stratum 10
server pool.ntp.org iburst
server pool.ntp.org iburst
server pool.ntp.org iburst
server pool.ntp.org iburst
server 127.127.1.0
restrict pool.ntp.org nomodify
restrict pool.ntp.org nomodify
restrict pool.ntp.org nomodify
restrict pool.ntp.org nomodify
restrict 127.0.0.1
driftfile /etc/ntp/ntp.drift
logfile /var/log/ntp.log
This code runs on my gateway computer running Slackware 13.1. The second "restrict" line allows only the computers in my home network to access the NTP daemon on the gateway. Other than the two restrict lines, you should be able to use that configuration since there are now pool servers that are farmed out as needed to clients.
 
Old 03-29-2011, 09:38 AM   #10
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,357

Rep: Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739
Quote:
multicastclient # listen on default 224.0.1.1
Try commenting out this line.
 
Old 03-29-2011, 09:43 AM   #11
audriusk
Member
 
Registered: Mar 2011
Location: Klaipėda, Lithuania
Distribution: Slackware
Posts: 354

Rep: Reputation: 198Reputation: 198
Are you by any chance dual booting into Windows? AFAIK, Windows stores localtime in system clock, while Linux can be configured to store localtime or UTC. What's inside /etc/hardwareclock file?
 
Old 03-29-2011, 09:45 AM   #12
mlpa
Member
 
Registered: May 2008
Location: Aveiro
Distribution: Slackware
Posts: 542

Original Poster
Rep: Reputation: 50
I'm trying commenting that line now.
 
Old 03-29-2011, 10:05 AM   #13
mlpa
Member
 
Registered: May 2008
Location: Aveiro
Distribution: Slackware
Posts: 542

Original Poster
Rep: Reputation: 50
Comment multicast is not doing anything special...
 
Old 03-29-2011, 10:18 AM   #14
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,357

Rep: Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739
What do you see if you do, as root, '/etc/rc.d/rc.ntpd stop' and then 'ntpd -gq'?

Last edited by allend; 03-29-2011 at 10:20 AM.
 
Old 03-29-2011, 10:50 AM   #15
mlpa
Member
 
Registered: May 2008
Location: Aveiro
Distribution: Slackware
Posts: 542

Original Poster
Rep: Reputation: 50
Quote:
Originally Posted by allend View Post
What do you see if you do, as root, '/etc/rc.d/rc.ntpd stop' and then 'ntpd -gq'?
I reboot the computer and it's correct now. Maybe it's the multicast thing.
That command gives
Code:
bash-4.1# ntpd -gq
ntpd: time slew +0.000000s
 
  


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
NTP Log Error Beginning in Slackware 13.1 tronayne Slackware 5 08-07-2010 04:12 AM
ntp does not sync on Slackware 13.1 Squall90 Slackware 3 07-21-2010 07:18 AM
ntp drift file in /etc/ntp instead of /var/lib/ntp - suggestion for a patch in Slack niels.horn Slackware 16 05-07-2009 07:35 PM
NTP problems shinobi59 Linux - Networking 5 02-21-2007 07:18 AM
NTP Problems carlosinfl Linux - Networking 3 06-09-2006 10:59 AM

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

All times are GMT -5. The time now is 01:54 AM.

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