You need to enable JavaScript to fully utilise this page.

RADclock Installation

The radclock daemon requires special support from the FreeBSD kernel. FreeBSD 9.1 and later natively support the radclock daemon natively. Earlier versions of FreeBSD require to patch the kernel. The kernel patch is provided with the radclock source tarball.

FreeBSD kernel

Patching the FreeBSD kernel

Let's assumed you downloaded the radclock source tarball into the /tmp directory. Run the following commands to patch your kernel.

cd /tmp
tar -xzf radclock-0.3.3.tar.gz
cd /usr/src
patch -Np0 < /tmp/radclock-0.3.3/kernel-patches/freebsd/RADclock-FreeBSD-7.2.patch

The patch will create a kernel configuration file based on GENERIC to which the RADCLOCK and PPS options have been added. You can edit or compile this kernel with the following commands.

Compiling the FreeBSD kernel

cd /usr/src
sudo make buildkernel KERNCONF=RADCLOCK.i386
sudo make installkernel KERNCONF=RADCLOCK.i386

On FreeBSD, the RADclock daemon requires the radclock module to be loaded using the kldload command. This can be automated by adding the following line to the /boot/loader.conf file.

radclock_load="YES"

Reboot before proceeding to the compilation of the daemon.

Installing the RADclock daemon

On Linux, make sure the development versions of libpcap and libnl are installed on your system.

On FreeBSD, the required libpcap library should be installed by default.

If you installed a patched kernel (from source or using the packaged image), make sure you rebooted your system before proceeding.

tar -xzf radclock-0.3.3.tar.gz
cd radclock-0.3.3 
./configure

Make sure the output of the configure script indicates that the kernel support has been detected.

configure: ----------------------------------------
configure: RADClock version 0.3.3 
configure: Found target arch: x86_64
configure: Compiling for linux
configure: Detected kernel RADClock extensions: yes
configure: Detected kernel access channel: yes
configure: get_counter syscall number: 295
configure: get_counter_latency syscall number: 296
configure: ----------------------------------------

Then make and install the daemon

make
sudo make install

Startup script - FreeBSD

Create the /etc/rc.d/radclock file and give execution permission.

#!/bin/sh
#
# PROVIDE: radclock
# REQUIRE: DAEMON
# KEYWORD: shutdown

radclock_enable="YES"
radclock_flags="-d"
radclock_pidfile="/var/run/radclock/radclock.pid"

. /etc/rc.subr

name="radclock"
rcvar=`set_rcvar`
command="/usr/local/bin/radclock"
extra_commands="reload"
load_rc_config $name

start_cmd="echo \"Starting ${name}.\"; /usr/bin/nice -5 ${command} ${radclock_flags} ${command_args}"

run_rc_command "$1"

Rotating Log File

The RADclock log file can be rotated by newsyslog sending a SIGUSR1 signal.

Use the kill command to identify the correct numerical value of SIGUSR1.

kill -l USR1

Edit /etc/newsyslog.conf and add the following line or equivalent.

/var/log/radclock.log    644  7   100  *  JC  /var/run/radclock/radclock.pid  30