NTPsec - BYO-NTP/recipes GitHub Wiki

Install

Install, configure, and start NTPsec.

curl -sS https://byo-ntp.github.io/tools/ntpsec/install.sh | sh

source code, and discussion.

Restart

FreeBSD

service ntpd restart

Pi OS / Debian / Linux

service ntpsec restart

Observe

  • Use ntpq commands
  • Measure your offset
  • Use something like telegraf + influxdb + grafana for statistics.

Disable

FreeBSD

service ntpd stop
sysrc ntpd_enable=NO

Linux

systemctl stop ntpsec
systemctl disable ntpsec

Rebuild / Update / Upgrade

Should it be necessary to build/rebuild NTPsec from sources, these instructions should help.

FreeBSD Ports

cd /usr/ports/net/ntpsec
pkg install -y portconfig bison pkgconf
git pull
make install clean

Linux build from source

Current state: FUBAR. After installing the newer NTPsec, it won't work with ntpq due to the python library version mismatches. Which is dreadfully difficult if you want to:

  • build NTPsec with the gpsd JSON driver. 😮‍💨
  • build NTPsec newer than 1.2.2 (2022-12-28) in 2025
git clone --depth=1 https://github.com/ntpsec/ntpsec.git
cd ntpsec
./waf configure --prefix=/usr
./waf build
./waf install

PYTHONPATH=/usr/lib/python3/dist-packages
PYTHONARCHDIR=/usr/lib/python3/dist-packages

--pythondir=/usr/lib/python3.11/dist-packages \
--pythonarchdir=/usr/lib/python3.11/dist-packages

References