home master site

clockspeed-conf

Current version: 0.4.5_0

The clockspeed-conf package provides configuration scripts to set up a clockspeed client and/or a taiclockd server using D. J. Bernstein's daemontools for supervision and his clockspeed package for time synchronisation.
It can sync to an ntp or a taiclock server.

The package installs two executables: clockspeed-conf and taiclockd-conf.

clockspeed-conf makes two supervise skeletons, one for clockspeed (DIR-speed) and the other for clockadjust (DIR-adjust).
The former runs clockspeed to keep your clock running evenly, the latter queries a time-keeping server in certain intervals. It does not symlink the resulting service directories into svscans central directory (often called /service/). You can inspect and change the new services before activating them manually.

taiclockd-conf makes one supervise skeleton to run a taiclock master (synced by clockspeed)

clockspeed-conf is distributed under the BSD License

For the impatient

Contents

Requirements
Installation
Usage
Details
References

Requirements

Required packages for using clockspeed-conf:

Installation

FreeBSD

  1. Get the port skeleton: clockspeed-conf-0.4.5_0-portskel.tar.gz
  2. As root untar the skeleton in /usr/ports
    tar -xvzf clockspeed-conf-0.4.5_0-portskel.tar.gz -C /usr/ports
    
  3. Install clockspeed-conf using the port
    cd /usr/ports/sysutils/clockspeed-conf
    make install clean
    
    This will install daemontools and clockspeed as dependencies.
  4. Read INSTALL.FreeBSD provided with the clockspeed port in order to configure your system with the right timezone. This is usually located at /usr/local/share/doc/clockspeed/.
    You may skip all sections concerning adjustments and calibration.

    Short summary: (cd /usr/src/share/zoneinfo; make -DLEAPSECONDS clean all install ; make clean)

  5. Now you are ready to read on at Usage
Note that the ports installation will add 3 users:

Linux

  1. Get daemontools and clockspeed from Bernstein's site (see Requirements) and install them as documented there.
  2. rpm -i http://foo42.de/distfiles/clockspeed-conf-0.4.5-0.i386.rpm
  3. You may want to set up your timezone with the appropriate file from /usr/share/zoneinfo/right/ in order to get the proper local time.
  4. Now you are ready to read on at Usage
The rpm assumes that clockspeed and daemontools are installed without patches in their default location.
Note that the rpm will add 3 users: If you are unhappy with this, use the source installation (section Others).

Others

  1. Get daemontools and clockspeed from Bernstein's site (see Requirements) and install them as documented there.
  2. Get the source: clockspeed-conf-0.4.5.tar.gz
  3. Untar the source:
    tar -xvzf clockspeed-conf-0.4.5.tar.gz
    
  4. Install the package:
    cd clockspeed-conf-0.4.3 && make install
    
  5. Before using clockspeed-conf, you need some pseudo users:
    clockspeed (time adjust service)
    log (output/error log)
    taiclock (taiclockd)
  6. Now you are ready to read on at Usage
  7. These names are suggestions only and may differ on your preferences. clockspeed-conf and taiclockd-conf are called with the users as commandline options.
    The required users can be easily generated with (e.g. on linux)

    groupadd log
    useradd -g log -c "daemontools log user" -d /nonexistent -s /bin/false log
    groupadd clockspeed
    useradd -g clockspeed -c "clockspeed adjust service" -d /nonexistent -s /bin/false clockspeed
    groupadd taiclock
    useradd -g taiclock -c "taiclock daemon" -d /nonexistent -s /bin/false taiclock
    

Usage

After installation refer to manpages clockspeed-conf(8) and taiclockd-conf(8) for usage details. Also refer to /usr/local/share/doc/clockspeed-conf/ for further documentation.

Network communication layout

When configuring an entire network, it is advisable to set up one local master (taiclock master) using ntp to sync to a stratum 2 ntp server, providing taiclock time service for the other systems (taiclock clients).

The taiclock master will run taiclockd as a service listening for UDP requests on port 4014.
It syncs to a stratum 2 ntp server of your choice using the clockspeed-adjust subsystem and calibrates its clock with clockspeed.
Note: It is important that this server does not run (x)ntpd syncing the local clock.

The taiclock clients will use clockspeed to calibrate their clock and taiclock to sync to the local taiclock master.

Ntp master server

First you need to select a time source. A list of public ntp servers can be found at ECE/CIS labs, UD. Please note that most timeserver administrators like to be notified when you use their clock.

Standalone client (using an ntp master)

Configure the clockspeed/adjust supervise scripts:
/usr/local/bin/clockspeed-conf clockspeed log /var/service/clockspeed ntp ip.ad.dr.es
Use the ip.ad.dr.es of a public ntp server.
Activate the service by making a symlink from /var/service/clockspeed-* to /service/

Taiclock master

First configure the server as standalone client as described above.
Then configure the taiclockd service:
/usr/local/bin/taiclockd-conf taiclock log /var/service/taiclockd
Activate the service by making a symlink from /var/service/taiclockd to /service/

Taiclock client

Configure the clockspeed/adjust supervise scripts:
/usr/local/bin/clockspeed-conf clockspeed log /var/service/clockspeed tai ip.ad.dr.es
Use the ip.ad.dr.es of your local taiclock master server. Activate the service by making a symlink from /var/service/clockspeed-* to /service/

Details

Filesystem hierarchy

Unfortunately the original clockspeed package does (can) not conform to the anarchy of file system hierarchy `standards`. By default the clockspeed service uses a socket /usr/local/clockspeed/adjust to ajust the local skew and the file /usr/local/clockspeed/etc/atto to remember the finetuning adjustment value. The adjust socket is required to do measurements of the local clock skew against a remote time server (tai or ntp).

If clockspeed is installed on FreeBSD via the port sysutils/clockspeed, the socket and atto file will reside in /usr/local/etc/clockspeed/.

By default, clockspeed-conf will expect clockspeed installed from its original source using DJB's filesystem layout.
When installed from FreeBSD ports, clockspeed-conf will be patched to use the FreeBSD hier(1) recommendations and interoperates with the FreeBSD clockspeed port.

If you mix the installations (port / original source), clockspeed-conf can be hinted to use the appropriate filesystem layout using environment variables. See clockspeed-conf(8) section ENVIRONMENT for details.

The adjust socket (fifo)

clockspeed provides a socket for clock adjustment after startup. On default installations it is located at /usr/local/clockspeed/adjust and is a fifo pipe.
If clockspeed was installed via FreeBSD ports, the adjust socket will reside in /usr/local/clockspeed/etc/adjust.

If adjust is a regular file, something went very wrong. Stop clockspeed, delete the file and restart clockspeed in that case.

The atto file

clockspeed writes its internal adjustment value into the file /usr/local/clockspeed/etc/atto.
If clockspeed was installed via FreeBSD ports, the adjust socket will reside in /usr/local/clockspeed/etc/atto.
Note: the file will be existent only after a few clock adjustments have been performed with clockadjust (done by the clockspeed-adjust framework). It may take some time until atto appears.

When you change your hardware (e.g. cpu, board, timing parameters), the (old) atto value will be incorrect and so will be your system clock. Delete it and restart clockspeed-adjust in order to generate a new adjustment.

Log directory

Historically supervised services log into /service/NAME/log/main/current. clockspeed-conf by default obeys this convention.
But this has several disadvantages and some folks flavour the hierarchy /service/NAME/log/NAME/current.
Try ps axuwww|grep multilog for reference.
To install the clockspeed services this way, simply set VA=yes in the calling environment of clockspeed-conf. Alternatively set ADJUST_LOGDIR=somename to log into /service/NAME/log/somename/current.

Credits

Author: Patrick Atamaniuk <atamaniuk at frobs dot net>
Based on work published by Frank Tegtmeyer
With help from the webmonster community
With help from Karsten Rohrbach, Clemens Fischer, Sebastian Benoit
Powered by djbdns, Powered by qmail

References

D. J. Bernstein - clockspeed
D. J. Bernstein - time
Frank Tegtmeyer - Clockspeed Setup