[TriLUG] keeping system time accurate (for Jim Ray)
Magnus
chrish at trilug.org
Sat Jun 28 10:57:03 EDT 2003
(basic lesson in UNIX daemons to follow, with Windows users in mind as
the target audience... though the ntpd stuff is probably useful to
others)
On Saturday, June 28, 2003, at 10:23 AM, Jim Ray wrote:
> i am getting another weird boot message regarding clock skew. it says
> my build may be incomplete and references the file submit.cf as having
> a
> modification time in the future.
Sounds like you need to set up ntpd. It's easy. These steps assume
you're running Red Hat Linux but can be adapted to work with other
distros. You need to do these as root.
Step 1: Create the file /etc/ntp.conf and make it look something like
this:
---/etc/ntp.conf begin---
driftfile /etc/ntp/drift
server clock1.unc.edu
server clock2.unc.edu
----/etc/ntp.conf end----
Step 2: Create the file /etc/ntp/step-tickers and make it look
something like this:
---/etc/ntp/step-tickers begin---
clock1.unc.edu
----/etc/ntp/step-tickers end----
Step 3: Run the following commands:
---begin---
cat /dev/null > /etc/ntp/drift
chkconfig --level 35 ntpd on
service ntpd start
----end----
What this does is synchronizes your time with the authoritative time
sources at UNC campus. It does one aggressive adjustment by actually
changing the time (using the time source specified in
/etc/ntp/step-tickers with the command ntpdate) and then after that, it
keeps the time in synch by periodically slowing down or speeding up the
duration of a second to stay in pace with the authoritative time
servers using the daemon ntpd.
In Linux, when you see a program with the letter "d" at the end, this
often implies that it is a "daemon", which in the Microsoft world is a
"service" in your control panel.
The Red Hat command "service" (which is in /sbin/) is used to control
daemons whose scripts are located in /etc/init.d/. For a very
educational experience, take a look at the daemon scripts in
/etc/init.d/ and see how they start up, shut down, report status, etc.
all from just one script. These are plain text files, like batch files
in windows, and completely safe to read with the program "less" (i.e.
"less /etc/init.d/ntpd"). So instead of using, in Windows, something
like Start->Settings->Control Panel->Services to control background
processes, you use the scripts in /etc/init.d and a command line
interface (RH probably has a GUI for this but IMHO it would start bad
habits if you learned it that way). The /etc/init.d/ thing is common
to most flavors of Linux as well as System V flavored UNIX. ntpd is
common to all flavors of UNIX though its startup/shutdown control will
be different between Linux/System V/BSD UNIX.
--
C. Magnus Hedemark
http://trilug.org/~chrish
PGP Key fingerprint = 984D 9A88 3D60 016F BE01 1506 60FB 85E1 9ABD 96F6
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://www.trilug.org/pipermail/trilug/attachments/20030628/5c389d86/attachment.pgp>
More information about the TriLUG
mailing list