LinuxQuestions.org
Help answer threads with 0 replies.
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-26-2012, 04:35 PM   #31
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,033

Rep: Reputation: 755Reputation: 755Reputation: 755Reputation: 755Reputation: 755Reputation: 755Reputation: 755

All I can say is that, since the pool servers have become available (I think about 15 years ago, maybe less) I have been running NTP with this configuration:
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
I have never, in all that time, experienced what you describe (and demonstrate).

This is my standard /etc/ntp.conf:
Code:
cat /etc/ntp.conf
# 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
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
#
# Log file
#
logconfig=allclock +allpeer +allsys +allsync
logfile /var/log/ntp.log
#
# Statistics stuff
#
statsdir /var/log/ntpstats/	# directory for statistics files
filegen	peerstats file peerstats type day enable
filegen	loopstats file loopstats type day enable
filegen	clockstats file clockstats type day enable

multicastclient	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
And this is the (untouched) standard /etc/rc.d/rc.ntpd that launches the daemon:
Code:
cat /etc/rc.d/rc.ntpd
#!/bin/sh
# Start/stop/restart ntpd.

# Start ntpd:
ntpd_start() {
  CMDLINE="/usr/sbin/ntpd -g"
  echo -n "Starting NTP daemon:  $CMDLINE"
  $CMDLINE -p /var/run/ntpd.pid
  echo
}

# Stop ntpd:
ntpd_stop() {
  echo -n "Stopping NTP daemon..."
  if [ -r /var/run/ntpd.pid ]; then
    kill -HUP $(cat /var/run/ntpd.pid)
    rm -f /var/run/ntpd.pid
  else
    killall -HUP -q ntpd
  fi
  echo
}

# Restart ntpd:
ntpd_restart() {
  ntpd_stop
  sleep 1
  ntpd_start
}

# Check if ntpd is running
ntpd_status() {
  if [ -e /var/run/ntpd.pid ]; then
    echo "ntpd is running."
  else 
    echo "ntpd is stopped."
    exit 1
  fi
}

case "$1" in
'start')
  ntpd_start
  ;;
'stop')
  ntpd_stop
  ;;
'restart')
  ntpd_restart
  ;;
'status')
  ntpd_status
  ;;
*)
  echo "usage $0 start|stop|restart|status"
esac
As the OP is running Slackware, I didn't feel it necessary to get into the start up script.

Works for me.
 
1 members found this post helpful.
Old 07-27-2012, 10:49 AM   #32
Petri Kaukasoina
Member
 
Registered: Mar 2007
Posts: 241

Rep: Reputation: 86
The undisciplined local clock used to work ok, but not any more. There can be problems in getting synchronized to it even if there are better outside sources if it's listed in ntp.conf. If you serve time to other computers and want to continue when there is no internet connection, you should now use the orphan mode, instead, not the local clock driver. For example a line "tos orphan 6". More info here: http://www.eecis.udel.edu/~mills/ntp/html/orphan.html and here http://support.ntp.org/bin/view/Support/OrphanMode.
 
1 members found this post helpful.
Old 07-27-2012, 05:24 PM   #33
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 755

Rep: Reputation: 226Reputation: 226Reputation: 226
Quote:
Originally Posted by Petri Kaukasoina View Post
Please note that this is for a network setup not a single host.

If all you have is a single host then there is nothing wrong with the local clock as it is actually all you have.
 
  


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
NTPd slackamp Slackware 1 12-26-2006 02:39 PM
ntpd seitan Linux - Software 1 11-29-2004 05:30 AM
ntpd jqcaducifer Linux - General 0 08-21-2003 11:09 PM
ntpd in RH 7.3 melissad Linux - Networking 4 04-28-2003 12:34 PM
ntpd susx Linux - Newbie 3 08-28-2001 04:18 PM


All times are GMT -5. The time now is 11:15 AM.

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