Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
doc:uci:ntpclient [2011/09/18 21:15] written_direcondocs:guide-user:services:ntp:client [2021/08/02 19:44] (current) – update vgaetera
Line 1: Line 1:
-====== Ntpclient Configuration ====== +====== Ntpclient configuration ======
 The ''ntpclient'' configuration file defines parameters for the [[http://doolittle.icarus.com/ntpclient/|ntpclient]] program, a small daemon that will keep the local clock in sync with time servers on the internet. The ''ntpclient'' configuration file defines parameters for the [[http://doolittle.icarus.com/ntpclient/|ntpclient]] program, a small daemon that will keep the local clock in sync with time servers on the internet.
  
 ===== Sections ===== ===== Sections =====
- 
 The configuration file consists of a section defining general daemon options, a section defining clock drift information, and one or more sections defining time server hosts to use. The configuration file consists of a section defining general daemon options, a section defining clock drift information, and one or more sections defining time server hosts to use.
  
 ==== Ntpclient ==== ==== Ntpclient ====
 +The ''ntpclient'' section defines general daemon options.
 +This is the default configuration for this section:
  
-The ''ntpclient'' section defines general daemon options. This is the default configuration for this section: +<code bash> 
-| ''config 'ntpclient' +config 'ntpclient' 
-        option 'interval' '600''' |+        option 'interval' '600' 
 +</code>
  
 The ''ntpclient'' section contains these settings: The ''ntpclient'' section contains these settings:
Line 20: Line 21:
  
 ==== Drift ==== ==== Drift ====
- +The ''ntpdrift'' section defines parameters to adjust the drift of the local clock so that it can run more accurately. 
-The ''ntpdrift'' section defines parameters to adjust the drift of the local clock so that it can run more accurately. Please see the [[http://doolittle.icarus.com/ntpclient/HOWTO|ntpclient HOWTO]] on how to compute these parameters.+Please see the [[http://doolittle.icarus.com/ntpclient/HOWTO|ntpclient HOWTO]] on how to compute these parameters.
  
 This is the default configuration for this section: This is the default configuration for this section:
-| ''config 'ntpdrift' + 
-        option 'freq' '0''' |+<code bash> 
 +config 'ntpdrift' 
 +        option 'freq' '0' 
 +</code>
  
 The ''ntpclient'' section contains these settings: The ''ntpclient'' section contains these settings:
Line 32: Line 36:
  
 ===== Hosts ===== ===== Hosts =====
- +To receive time, at least one host must be configured through a ''host'' section. 
-To receive time, at least one host must be configured through a ''host'' section. OpenWrt will try the specified hosts in order, and use the first one that is responding to time requests. OpenWrt uses the [[http://www.pool.ntp.org/|NTP Pool]] to locate a close-by time server.+OpenWrt will try the specified hosts in order, and use the first one that is responding to time requests. 
 +OpenWrt uses the [[http://www.pool.ntp.org/|NTP Pool]] to locate a close-by time server.
  
 These are the default hosts: These are the default hosts:
-| ''config 'ntpserver'+ 
 +<code bash> 
 +config 'ntpserver'
         option 'hostname' '0.openwrt.pool.ntp.org'         option 'hostname' '0.openwrt.pool.ntp.org'
         option 'port'     '123'         option 'port'     '123'
Line 50: Line 57:
 config 'ntpserver' config 'ntpserver'
         option 'hostname' '3.openwrt.pool.ntp.org'         option 'hostname' '3.openwrt.pool.ntp.org'
-        option 'port'     '123''' |+        option 'port'     '123' 
 +</code>
  
 A ''host'' section contains these settings: A ''host'' section contains these settings:
Line 58: Line 66:
 | ''interface'' | text | no | //(none)// | Only test this host if the specified interfaces comes up. | | ''interface'' | text | no | //(none)// | Only test this host if the specified interfaces comes up. |
  
-===== Ntpclient Startup Details ===== +===== Ntpclient startup details ===== 
- +The ntpclient is started via the hotplug subsystem upon any network interface startup, see ''/etc/hotplug.d/iface/20-ntpclient''. 
-The ntpclient is started via the ''hotplug.d'' subsystem upon any network interface startup (for the curious, see ''/etc/hotplug.d/iface/20-ntpclient''). The script starts the daemon in 4 phases:+The script starts the daemon in 4 phases:
   - **preliminary test** - the script checks if the ntpclient is already running.   - **preliminary test** - the script checks if the ntpclient is already running.
   - **drift** - the scripts sets the specified ''drift'' in system clock.   - **drift** - the scripts sets the specified ''drift'' in system clock.
Line 66: Line 74:
   - **operational phase** - the ntpclient is started with the first reachable ''host'' and user configuration options (''interval'' etc.) of polling and time adjustment   - **operational phase** - the ntpclient is started with the first reachable ''host'' and user configuration options (''interval'' etc.) of polling and time adjustment
  
-===== Ntpclient Shutdown Details =====+===== Ntpclient shutdown details ===== 
 +All instances of the ntpclient are killed via the hotplug subsystem upon any network interface shutdown, see ''/etc/hotplug.d/iface/20-ntpclient''.
  
-All instances of the ntpclient are killed via the hotplug.d subsystem upon any network interface shutdown(!) (for the curious, see /etc/hotplug.d/iface/20-ntpclient). 
  • Last modified: 2021/08/02 19:44
  • by vgaetera