NTP

From Void Linux Wiki
Jump to: navigation, search

By default Void does not provide an NTP daemon, so in order to have accurate network-synced time, one must be installed.

The following implementations of NTP are available in Void: OpenNTPD, Network Time Protocol daemon, Chrony and Busybox.

OpenNTPD

OpenNTPD provides the ability to sync the local clock to remote NTP servers and can act as NTP server itself. It is part of the OpenBSD project.

Installation

# xbps-install -S openntpd
# ln -s /etc/sv/openntpd/ /var/service/

Configuration

To configure OpenNTPD, you need to edit /etc/ntpd.conf. See ntpd.conf(5) for all available options. After configuring, check the configuration file for validity by executing:

$ ntpd -n

Network Time Protocol daemon

ntp is the reference implementation of the NTP protocol. NTP can be run both as a client and as a server.

Installation

# xbps-install -S ntp
# ln -s /etc/sv/isc-ntpd/ /var/service/

Configuration

See ntp.conf(5)

After editing /etc/ntp.conf restart the ntp service to use the changes.

# sv restart /var/service/isc-ntpd

Chrony

chrony is a NTP client and server that is roaming friendly and designed specifically for systems that are not online all the time.

Installation

# xbps-install -S chrony
# ln -s /etc/sv/chronyd/ /var/service/

Configuration

See chrony.conf(5)

Busybox

busybox combines tiny versions of many common UNIX utilities into a single small executable, one of the many utilities it provides is an NTP daemon.

Installation

# xbps-install -S busybox
# ln -s /etc/sv/busybox-ntpd/ /var/service/

Configuration

See ntp.conf(5)

The ntpd service

The symlink /etc/sv/ntpd will point to the NTP service in order of installation date. And can be used in place of the NTP daemon's name, allowing switching between NTP implementations without enabling and disabling their services.

Setting the Hardware Clock

If your hardware clock has the incorrect time you can set it to the system clock using:

# hwclock --systohc