source: basicnet/netprogs/ntp/ntp-config.xml@ 369af35a

10.0 10.1 11.0 6.0 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 ken/refactor-virt krejzi/svn lazarus nosym perl-modules qt5new systemd-11177 systemd-13485 trunk v5_1 v5_1-pre1 xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 369af35a was 369af35a, checked in by Igor Živković <igor@…>, 18 years ago

s/source/./ in init scripts

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@1776 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 2.6 KB
Line 
1<sect2>
2<title>Configuring <application><acronym>NTP</acronym></application></title>
3
4<sect3><title>Config files</title>
5<para><filename>/etc/ntp.conf</filename></para>
6</sect3>
7
8<sect3><title>Configuration Information</title>
9
10<para>The following configuration file defines various <acronym>NTP</acronym>
11servers to use with the primary server designated with the prefer tag. It also
12creates a drift file where <command>ntpd</command> stores the frequency
13offset. Since the documentation included with the package is sparse,
14visit the <acronym>NTP</acronym> website at
15<ulink url="http://www.ntp.org/"/> for more information.</para>
16
17<screen><userinput>server time-a.nist.gov prefer
18server time-b.nist.gov
19server tick.usno.navy.mil
20driftfile /var/cache/ntp.drift</userinput></screen>
21</sect3>
22
23<sect3><title>Synchronizing the time</title>
24
25<para>There are two options. Option one is to use run <command>ntpd</command>
26continuously and allow it to synchronize the time in a gradual manner. The other
27option is to run <command>ntpd</command> periodically (using cron)
28and update the time each time <command>ntpd</command> is scheduled.</para>
29
30<para>If you choose Option one, then create the bootscript
31<filename>/etc/rc.d/init.d/ntp</filename> and put the start and
32stop symlinks:</para>
33
34<screen><userinput><command>cat &gt; /etc/rc.d/init.d/ntp &lt;&lt; "EOF"</command>
35#!/bin/sh
36# Begin $rc_base/init.d/ntp
37. /etc/sysconfig/rc
38. $rc_functions
39case "$1" in
40 start)
41 echo "Starting ntpd..."
42 loadproc ntpd
43 ;;
44 stop)
45 echo "Stopping ntpd..."
46 killproc ntpd
47 ;;
48 restart)
49 $0 stop
50 sleep 1
51 $0 start
52 ;;
53 status)
54 statusproc ntpd
55 ;;
56 *)
57 echo "Usage: $0 {start|stop|restart|status}"
58 exit 1
59 ;;
60esac
61# End $rc_base/init.d/ntp
62<command>EOF
63chmod 755 /etc/rc.d/init.d/ntp &amp;&amp;
64cd /etc/rc.d/init.d &amp;&amp;
65ln -sf ../init.d/ntp ../rc0.d/K46ntp &amp;&amp;
66ln -sf ../init.d/ntp ../rc1.d/K46ntp &amp;&amp;
67ln -sf ../init.d/ntp ../rc2.d/K46ntp &amp;&amp;
68ln -sf ../init.d/ntp ../rc3.d/S26ntp &amp;&amp;
69ln -sf ../init.d/ntp ../rc4.d/S26ntp &amp;&amp;
70ln -sf ../init.d/ntp ../rc5.d/S26ntp &amp;&amp;
71ln -sf ../init.d/ntp ../rc6.d/K46ntp</command></userinput></screen>
72
73<para>If you prefer to start ntpd periodically, add the following command to
74the root's <filename>crontab</filename>:</para>
75<screen><userinput>ntpd -q</userinput></screen>
76
77</sect3>
78
79</sect2>
Note: See TracBrowser for help on using the repository browser.