--- categories: ['Devuan','Network','Service'] date: 2020-04-25T12:17:36+02:00 description: "To use on Devuan the OpenNTPD time synchronization client" draft: false tags: ['Devuan','OpenNTPD','ntp','client','temps'] title: "Devuan: use the OpenNTPD time synchronization client" translationKey: "devuan-openntpd-client" --- ## Description **OpenNTPD** is a service that can be used to synchronize the system clock to the time servers using the {{< abbr NTP "Network Time Protocol" >}}. **OpenNTPD** is a part the OpenBSD base system. It was ported to others OSes, as Devuan. ## Installation With the `apt` tool: `apt install openntpd` ## Configuration * The file config is: `/etc/opennptd/ntpd.conf` By default, it runs without no needed modification. {{< file "openntpd-ntpd.conf-1.14" cfg "/etc/opennptd/ntpd.conf" >}} **Explanations** About options: * `server`: to target on time server, in particular. * `servers`: to targer a pool of time servers - *prefer this* * `sensor`: to use local timedelta sensor ## Utilisation ### Checks To check the file config, use the option `-n`, as-is:
`# openntpd -n`
`configuration OK` If not good, you need to review the file config. --- `ntpctl` is the tool to control the time informations. * the option `-s all` - or `-sa` - is to display availables informations. {{< code "openntpd-ntpctl-sa-example" shell >}} {{< note info >}} To known all usefull options, please see the manpage {{< anchor ntpctl manpages >}}. {{}} ### Service The service name is **openntpd**, to manage with the `service`. `service openntpd command` * `command` is one of possibles actions on a service, as `start`, `stop`, `restart`. ## Troubleshooting It can happen at startup that there is a time lag. Using the option `-s` solve: {{< code "sys-devuan-openntpd-option-s" shell >}} ### Constraint It seems the constraint option is not available! {{< note info >}} This option `constraint` ensures that time queries are made on the protocol {{< abbr HTTPS "HyperText Transfert Protocole Secure" >}}, via {{< abbr TLS "Transport Layer Security" >}}. {{}} ### peer not valid You have this message: {{< code "openntpd-ntpctl-sa-peer-not-valid-example" shell >}} Wait a little for the ntp queries to be returned.
Normally at the next query, this should no longer be the case. Otherwise, check that the NTP servers registered in the file config are well written, reachable and functional. ## Documentation The NTP protocol is defined in: * version **3** by {{< anchor "RFC 1305" "rfc 1305" >}} * version **4** by {{< anchor "RFC 5905" "rfc 5905" >}} {{< rfcdoc 1305 >}} {{< rfcdoc 5905 >}} ### Manpages Please, read the manpages: * {{< man ntpd 8 >}}, {{< man ntpd.conf 5 >}}, {{< man ntpctl 8 >}} ---