The NTP package contains a client and server to keep the time synchronized between various computers over a network. This package is the official reference implementation of the NTP protocol.
Download (HTTP): http://anduin.linuxfromscratch.org/sources/BLFS/6.2.0/n/ntp-stable-4.2.0a-20060224.tar.gz
Download (FTP): ftp://anduin.linuxfromscratch.org/BLFS/6.2.0/n/ntp-stable-4.2.0a-20060224.tar.gz
Download MD5 sum: 49d4a704b49dc1ef2a7ec0b7938c3ae1
Download size: 2.3 MB
Estimated disk space required: 22.1 MB
Estimated build time: 0.4 SBU
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/ntp
Install NTP by running the following commands:
./configure --prefix=/usr --bindir=/usr/sbin \ --sysconfdir=/etc && make
To test the results, issue: make check.
Now, as the root user:
make install && install -v -m755 -d /usr/share/doc/ntp-4.2.0a && cp -v -R html /usr/share/doc/ntp-4.2.0a/
The following configuration file defines various NTP servers with open access from different continents. It also creates a drift file where ntpd stores the frequency offset. Since the documentation included with the package is sparse, visit the NTP website at http://www.ntp.org/ and http://www.pool.ntp.org/ for more information.
cat > /etc/ntp.conf << "EOF" # Africa server tock.nml.csir.co.za # Asia server 0.asia.pool.ntp.org # Australia server 0.oceania.pool.ntp.org # Europe server 0.europe.pool.ntp.org # North America server 0.north-america.pool.ntp.org # South America server 2.south-america.pool.ntp.org driftfile /var/cache/ntp.drift EOF
There are two options. Option one is to run ntpd continuously and allow it to synchronize the time in a gradual manner. The other option is to run ntpd periodically (using cron) and update the time each time ntpd is scheduled.
If you choose Option one, then install the /etc/rc.d/init.d/ntp init script included in the blfs-bootscripts-20060910 package.
make install-ntp
If you prefer to run ntpd periodically, add the following command to root's crontab:
ntpd -q
Execute the following command if you would like to set the hardware clock to the current system time at shutdown and reboot:
ln -v -sf ../init.d/setclock /etc/rc.d/rc0.d/K46setclock && ln -v -sf ../init.d/setclock /etc/rc.d/rc6.d/K46setclock
The other way around is already set up by LFS.
Last updated on 2007-01-30 12:28:32 -0600