<?xml version="1.0" encoding="UTF-8"?>
<!-- **************************************************************************
.... For copyright and licensing terms, see the file named COPYING.
.... **************************************************************************
.-->
<?xml-stylesheet href="docbook-xml.css" type="text/css"?>

<refentry id="taiclockd">

<refmeta xmlns:xi="http://www.w3.org/2001/XInclude">
<refentrytitle>taiclockd</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="manual">user commands</refmiscinfo>
<refmiscinfo class="source">djbwares</refmiscinfo>
<xi:include href="version.xml" />
</refmeta>

<refnamediv>
<refname>taiclockd</refname>
<refpurpose>announce the system's clock through TAICLOCK</refpurpose>
</refnamediv>

<refsynopsisdiv>
<cmdsynopsis>
<command>taiclockd</command>
</cmdsynopsis>
</refsynopsisdiv>

<refsection>
<title>Description</title>

<para>
<command>taiclockd</command> announces the local UNIX clock through <ulink url="http://cr.yp.to/proto/taiclock.txt">the TAICLOCK protocol</ulink>.
It accepts TAICLOCK requests from hosts around the Internet, and responds with the system's current time.
</para>

<para>
Normally <command>taiclockd</command> is run via a server program such as <command>udp-socket-listen</command> to listen for TAICLOCK queries from hosts around the Internet.
It understands the <envar>LISTEN_PID</envar> and <envar>LISTEN_FDS</envar> environment variable convention for having an already-listening socket passed to it by such a program, and uses the last open file descriptor in the list that refers to a UDP/IPv6 socket.
If no such open file descriptor is provided it falls back to opening its own UDP/IPv6 socket, bound to port 4014 of the IP address given by the value of the <envar>IP</envar> environment variable.
</para>

<para>
<command>taiclockd</command> is capable of handling both IPv4 and IPv6 requests on combined-stack systems.
</para>

<para>
<emphasis>Do not run <code>taiclockd</code> if your system is tuned by <code>xntpd</code>.</emphasis>
See <personname><firstname>Daniel</firstname> <othername>J.</othername> <surname>Bernstein</surname></personname>'s <ulink url="http://cr.yp.to/proto/utctai.html">UTC, TAI, and UNIX time</ulink> paper for further discussion.
</para>

</refsection>

<refsection>
<title>Security</title>
<para>
<command>taiclockd</command> does not need to run as root.
</para>
</refsection>

<refsection>
<title>History</title>
<para>
<command>taiclockd</command> was originally part of <personname><firstname>Daniel</firstname> <othername>J.</othername> <surname>Bernstein</surname></personname>'s clockspeed toolset in 1998.
It was converted to IPv6 in 2025 with the original IPv4-only tool renamed to <citerefentry><refentrytitle>taiclock4d</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
</para>
</refsection>

<refsection>
<title>Author</title>
<para>
Original code and documentation by <personname><firstname>Daniel</firstname> <othername>J.</othername> <surname>Bernstein</surname></personname>.
Documentation modernizations by <personname><firstname>Jonathan</firstname> <surname>de Boyne Pollard</surname></personname>.
</para>
</refsection>

</refentry>
