RADclock Installation
The RADclock requires a patched kernel that provides support for feed-forward synchronisation algorithms. Kernel patches are shipped with the source tarball and patched kernel packages can be found on the download page.
Easy install with packages - Linux
Download a package kernel image package and a daemon package from the Download. Make sure the libpcap, librt and libnl libraries are installed on your system. Install the RADclock packages using your distribution package manager tools. For example for Ubuntu 8.10:
dpkg -i linux-image-2.6.27-14-generic_2.6.27-14.33_amd64.deb dpkg -i radclock_0.2.2_amd64.deb
You are all set, reboot your system and configure the RADclock daemon.
Installing a patched kernel from sources - Linux
Let's assumed you downloaded the radclock source tarball into the /tmp directory. Let's also assume you downloaded a pristine Linux 2.6.27 kernel from Kernel.org and untared it into /usr/src/linux. Then run the following commands to patch your kernel.
cd /tmp tar -xzf radclock-0.2.2.tar.gz cd /usr/src/linux patch -p1 < /tmp/radclock-0.2.2/kernel-patches/linux/2.6.27/*
Then build the kernel using your favorite method. Make sure the kernel config option CONFIG_RADCLOCK is set to 'y' preferably. The RADclock patches can partially be built as module, but this method is not supported.
Install the kernel and reboot before proceeding to the compilation of the daemon.
Installing a patched kernel from sources - FreeBSD
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.2.2.tar.gz cd /usr/src patch -Np0 < /tmp/radclock-0.2.2/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.
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 from sources
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.2.2.tar.gz cd radclock-0.2.2 ./configure
Make sure the output of the configure script indicates that the kernel support has been detected.
configure: ---------------------------------------- configure: RADClock version 0.2.2 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"
Startup script - Linux
Having the RADclock start at boot time is distribution specific and is not covered in here. Following is an example of a /etc/init.d/radclock script used to control the RADclock daemon.
#!/bin/sh
### BEGIN INIT INFO
# Provides: radclock
# Required-Start: mountvirtfs ifupdown $local_fs
# Default-Start: S
# Default-Stop: 0 6
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=`which radclock`
NAME=radclock
DESC="the $NAME daemon"
DAEMON_OPTS="-d"
test -x $DAEMON || exit 0
# Include radclock defaults if available
if [ -f /etc/default/radclock ] ; then
. /etc/default/radclock
fi
set -e
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --pidfile /var/run/radclock/$NAME.pid \
--exec $DAEMON -- $DAEMON_OPTS
echo "done."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --retry TERM/2/TERM/forever/TERM \
--pidfile /var/run/radclock/$NAME.pid --exec $DAEMON
echo "done."
;;
reload)
echo "Reloading $DESC configuration files."
start-stop-daemon --stop --signal 1 --quiet --pidfile \
/var/run/radclock/$NAME.pid --exec $DAEMON
;;
restart)
echo -n "Restarting $DESC: "
start-stop-daemon --stop --quiet --retry TERM/2/TERM/forever/TERM \
--pidfile /var/run/radclock/$NAME.pid --exec $DAEMON
sleep 2
start-stop-daemon --start --quiet --pidfile \
/var/run/radclock/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
echo "done."
;;
status)
echo -n "$DESC status: "
if [ ! -r "/var/run/radclock/$NAME.pid" ]; then
echo "is not running."
exit 3
fi
if read pid < "/var/run/radclock/$NAME.pid" && ps -p "$pid" > /dev/null 2>&1; then
echo "is running with pid $pid."
exit 0
else
echo "is not running but /var/run/radclock/$NAME.pid exists."
exit 1
fi
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|reload|status}" >&2
exit 1
;;
esac
exit 0