Network Time Protocol (NTP)
24 November 2004

Status

  • The ntp daemon is no longer configured by default to work, so I uninstalled it on spello
  • Instead, ntpdate works fine by default, if it's added to cron
  • On 7 Oct 2005 I removed ntpdate from root's cron, as it seemed to be running hourly anyway -- or does it really take several minutes to get a new time after it's started by cron? Check this.

    Oct  7 11:55:01 localhost /USR/SBIN/CRON[11143]: (root) CMD (/etc/init.d/ntpdate start >/dev/null 2>&1)
    Oct  7 11:55:04 localhost ntpdate[11145]: step time server 204.74.68.55 offset -0.366200 sec

Software and Guides

Commands
  • just start ntpdate
    • tail /var/log/syslog for the result
  • crontab -e
    • # Synchronize the time with /etc/default/ntp-servers
      55 * * * *      /etc/init.d/ntpdate start >/dev/null 2>&1
If your system clock is way off and NTP doesn't work, try this before blaming hardware:
  1. delete /etc/adjtime
  2. run /etc/init.d/hwclock.sh
  3. run adjtimexconfig
  4. run ntpdate <server>
  5. run /etc/init.d/ntp-server start
The adjtime could be off due to a bad clock on the previous box the hard drive was in.

Installation history

23 Nov 04: I removed ntp from spello, since it's no longer configured by the package maintainer and requires customizing at a level that is not worth my time. In contrast, the simpler ntpdate is working fine out of the box, and may be more appropriate anyway. Just add these lines to crontab -e

# Synchronize the time with /etc/default/ntp-servers
55 * * * *      /etc/init.d/ntpdate start >/dev/null 2>&1
I did that on spello, clitunno, cyberspace, sigillo, and gubbio. I had to purge the package first to remove the previous configuration, which didn't work by default.  Andrey has ntp-server working fine on karamba and paco however.

11 Feb 03: Status

  • The ntp-simple daemon (ntpd) is running on Spello against a second stratum public time server, keeping it synchronized at all times
  • The ntpdate application is running on Sigillo and Gubbio once a day as a cron job, sychronizing with Spello
  • I've not verified that this is working on a regular basis, but the installation did synchronize the machines

I installed ntp 4.1.1b-3 on Spello (just install ntp) and found three second-tier public time servers:

204.74.68.55   216.27.190.202   204.87.183.6

I got these numbers from http://www.eecis.udel.edu/~mills/ntp/clock2a.html, the second stratum of public time servers; they are California servers in LA, San Jose, and Berkeley.

Spello is the local network's timekeeper; the other machines get their time from it through ntpdate (just install ntpdate). I installed ntpdate on sigillo and gubbio  and gave spello as the  ntp server.

On spello, I opened SysV (ksysv -caption "%c") and added the ntp-simple daemon to run-level 2.

I then ran kcron to create cron jobs on gubbio and sigillo (at the same time, I added a cron job for updatedb). On sigillo, I tried to define the cron jobs using anacron, which runs tasks as close to the desired time as possible and doesn't assume the machine is always running, but I couldn't figure out the logic of it -- see details in cron jobs.  So I left them as straight cron jobs.

 

 

top
Debate
Evolution
CogSci

Maintained by Francis F. Steen, Communication Studies, University of California Los Angeles


CogWeb