Unix Tip: Configuring NTP
Send in your Unix questions today!
See additional Unix tips and tricks
Setting up a Unix system to be an NTP client is generally straightforward.
On those Unix platforms that include NTP in the default configuration,
you may only need to make a few adjustments to NTP's default configuration
file for the system to sync up to a reference time server(s) and keep
good time. On a Solaris system, for example, this involves copying a
prototype file and customizing it. You can insert the names or IP addresses
of the time server(s) you have elected to use -- whether public NTP servers
or NTP servers that you have set up on your local network -- or configure
the system to receive broadcast time updates. Once a system has been
configured, the NTP daemon will start whenever the system boots and run
continuously in the background.
Configuration of NTP servers, on the other hand, can be simple or complex,
depending on the options that you wish to use and how well you understand
the NTP service.
Many Unix systems today ship with NTP software. These include Solaris, SCO,
FreeBSD and Mac OS X. On some Linux systems, you will need to download and
install a package, such as ntp-4.1.2-5.i386.rpm, to acquire NTP services.
Once configured, the NTP service requires little or no administration. New
clients will have to be configured and an occasional verification of your
time sources may be warranted, but the service otherwise runs unattended.
Boot-time NTP
If you only want to synchronize your systems at boot time, you can configure
an ntpdate command in your start scripts. This will ensure that your system
starts up with a reasonable clock setting. On a Solaris system, this might
be done with a script like that shown below, installed as /etc/rc2.d/S73ntpdate.
------------------------------ cut here ------------------------------
#!/bin/sh
#
# synchronize date to NTP server at start-up
/usr/sbin/ntpdate -s -b -p 8 -u 129.6.15.28 216.200.93.8
------------------------------ cut here ------------------------------
In this start script, we're synchronizing our system clock to publicly
available time servers in the Washington, DC area. The options used in this
command are as follows:
option means
-s divert logging output to syslogd
-b force time stepping instead of skewing
-p specify number of time samples to be obtained from the server
-u use an unprivileged port (this can be important if privileged ports are
blocked by a firewall). NOTE: NTP uses port 123.
Notice that the ntpdate command in the script includes all the information that
it needs to run, obviating the need to insert this information from the NTP
configuration file.
On systems which boot from rc.conf files (such as FreeBSD and its derivatives),
you would need to modify additional files to use NTP. For example, you would
enable ntpdate in the /etc/rc.conf file by setting ntpdate_enable="YES".
Arguments for the ntpdate command, including the server(s) you intend to
obtain time information from need to be included in the ntpdate_flags line.
These lines might look like this:
ntpdate_enable="YES"
ntpdate_flags="-b 129.6.15.28 216.200.93.8"
Using the ntpdate command on system boot will keep your system clocks in
closer proximity and is generally a good idea. At the same time, for
synchronization, using only boot time commands is of very limited utility.
Many Unix systems run for months, even
Essential JavaFX
Get started building rich Web apps quickly with an introduction to the power of JavaFX key features -- scene node graphs, nodes as components, the coordinate system, layout options, colors and gradients, custom classes with inheritance, animation, binding, and event handlers.Enter now!
The Nomadic Developer
Consulting can be hugely rewarding, but it's easy to fail if you are unprepared. To succeed, you need a mentor who knows the lay of the land. Aaron Erickson is your mentor, and this is your guidebook. Enter now!













cheap wow gold
You know ,I have some wow gold,and my friend also has some World of Warcraft Gold,do you kouw they have the same meaning,Both of them can be calledwarcraft gold,I just want to
buy wow gold,because there are many
cheap wow gold
multcast versus broadcast NTP client
Greetings,What is needed in the ntp.conf file to tell a client
to listen for a broadcast? (not multicast...)
Thanks!
Jay