LinuxQuestions.org
Visit Jeremy's Blog.
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 07-21-2010, 05:46 AM   #1
Squall90
Member
 
Registered: Oct 2009
Distribution: Currently several distros :S
Posts: 148

Rep: Reputation: 29
ntp does not sync on Slackware 13.1


Hi,

since I installed 13.1 (I crashed my system as I tried to upgrade 13.0 to 13.1) ntp does not synchronize anymore.

My /etc/ntp.conf:
Quote:
restrict default kod nomodify notrap nopeer noquery

restrict 127.0.0.1
restrict 1.2.3.4 nomodify
restrict 192.168.0.0 mask 255.255.255.0 modify

server 0.de.pool.ntp.org
server 1.de.pool.ntp.org
server 2.de.pool.ntp.org
server 3.de.pool.ntp.org

driftfile /etc/ntp.drift
logfile /var/log/ntp.log

server 127.127.1.0
fudge 127.127.1.0 stratum 10
When I start the server manually there are no errors. Some time later, when I try to shut it down (or restart it) I get this error:
Quote:
Stopping NTP daemon.../etc/rc.d/rc.ntpd: line 16: kill: (2268) - No such process
What is wrong?


Thanks
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 07-21-2010, 06:06 AM   #2
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
You may want to start ntpd manually with the -d argument to get some debugging output. I found the same recently, as did someone else here on LQ who recently posted a thread with almost identical title as yours.

In my case, I discovered I needed a "+" sign on my logconfig entry in ntp.conf which was not required before, but there was no error message telling me this until I manually started debugging it. I don't recall what the other poster's problem was.

Since usable ntp.conf files are difficult to find (at least that's been my experience), here's what mine currently looks like, for your reference:

Code:
# Sample /etc/ntp.conf:  Configuration file for ntpd.
#
logfile /var/log/ntp.log
logconfig +all
#
# Canada pool servers (use only three at a time):
#
#server 0.ca.pool.ntp.org minpoll 12 maxpoll 15
server 1.ca.pool.ntp.org minpoll 12 maxpoll 15
server 2.ca.pool.ntp.org minpoll 12 maxpoll 15
server 3.ca.pool.ntp.org minpoll 12 maxpoll 15
# server 127.127.1.0    # local clock
#
# 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
statsdir /var/log/ntpstats/
#
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
#
# multicastclient                       # listen on default 224.0.1.1
# listen eth0
# listen on lo
# broadcastdelay        10.0
#
# 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/ntp.keys
#trustedkey     62889
#requestkey     12888
#controlkey     61421
#
# Don't serve time or stats or trust anyone by default (secure):
# Trust ourselves:
restrict 127.0.0.1
restrict default noserve noquery notrust nomodify
 
2 members found this post helpful.
Old 07-21-2010, 07:17 AM   #3
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,061

Rep: Reputation: 769Reputation: 769Reputation: 769Reputation: 769Reputation: 769Reputation: 769Reputation: 769
This may sound odd, but look at /etc/ntp/drift (just cat it). There should be a number in it, can be zero, negative or positive, doesn't matter, but there needs to be a value -- in the "old days," NTP wouldn't sync up properly if that file was null and you had to poke a zero in it for things to get going (echo 0 > /etc/ntp/drift). After a raw install of 13.1 I found that I had to do that, who knows why, might be worth a shot.

The other thing is your ntp.conf file; this one works (on all my systems, Slackware and SPARC Solaris). Edit the country code to suit your location:
Code:
server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10
#server  pool.ntp.org
server  0.us.pool.ntp.org
server  1.us.pool.ntp.org
server  2.us.pool.ntp.org

#
# 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
I like to have a log file and I stick it in /tmp/ntp.log. It gets blown away every time the daemon is started. I do that by slightly modifying /etc/rc.d/rc.ntpd:
Code:
#!/bin/sh
# Start/stop/restart ntpd.

# Start ntpd:
ntpd_start() {
  # Clear the log file
  >/tmp/ntp.log
  CMDLINE="/usr/sbin/ntpd -g"
  echo -n "Starting NTP daemon:  $CMDLINE"
  $CMDLINE -p /var/run/ntpd.pid -l /tmp/ntp.log
  echo
}
You may need to set your clock (with ntpdate) just to get it "close enough" that NTP will sync (if it's too far off, ntpd won't sync).

And, finally, it might be an idea to ping the servers you've specified and see what kind of response you get (just make sure the things actually exist, eh).

Hope this helps some.

Last edited by tronayne; 07-21-2010 at 07:18 AM.
 
Old 07-21-2010, 07:18 AM   #4
Squall90
Member
 
Registered: Oct 2009
Distribution: Currently several distros :S
Posts: 148

Original Poster
Rep: Reputation: 29
lol... You're a (Sub)Genius^^ Thanks to the "-g" I found out that ntpd had a problem with line 5 of my config file. I removed "modify" at the end of the line and then it worked.

Thank you – I probably should have read the man page first but I thought errors would be logged in the log file.
 
  


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
[SOLVED] Slackware server - ntp time sync stops after a day tennis_slacker Slackware 81 08-04-2010 09:05 AM
NTP sync problem Uday123 Red Hat 3 11-13-2009 07:57 AM
NTP sync noir911 Linux - Server 1 03-29-2008 06:50 PM
NTP Sync? carlosinfl Linux - Networking 12 04-13-2006 10:33 AM
ntp time sync eyewittness Linux - Networking 2 08-11-2004 09:18 AM


All times are GMT -5. The time now is 01:28 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