Install ntpsec on FreeBSD
A short article on how to install ntpsec on FreeBSD. Tested with 0.9.7 and 1.0.0.
Note
There is/was a bug in the ntpdate implementation that set the clock
to a completely bogus value. So I’ve since written a simple script that
runs from cron
to fetch the time from a near NTP server.
Downloading
You can find several download methods on the ntpsec website.
Installation
As of 2017-07-29, the is no port for ntpsec yet. So on FreeBSD you have to compile it yourself. Fortunately, this is not difficult.
Prerequisites
You will need Python to build ntpsec
. Additionally, many of the helper
programs are written in Python. In this article, I’ll be using Python 3.6.
The asciidoc
program and the DocBook style sheets are needed to build the documentation.
Building the software
To build the software, I downloaded the source distribution from the FTP site. Cloning the repo from gitlab also worked.
Downloading a tarball from gitlab or github would complain about a missing
.autorevision-cache
file during the build.
> python3 waf configure --prefix=/usr/local --python=/usr/local/bin/python3
> python3 waf build
> cd build/main/ntpclients/
> sed -i '' -e 's/env python/env python3/' ntp*
> cd -
# python3 waf install
The sed
command is necessary because the scripts call python, not python3.
Configuration
The standard /etc/rc.d/ntpd
seems to work well, provided I set the
following in my /etc/rc.conf
:
ntpd_enable="YES"
ntpd_program="/usr/local/sbin/ntpd"
ntpd_sync_on_start="YES"
For comments, please send me an e-mail.
Related articles
- Profiling Python scripts(6): auto-orient
- Profiling with pyinstrument
- From python script to executable with cython
- On Python speed
- Python 3.11 speed comparison with 3.9