xref: /freebsd/contrib/ntp/html/tickadj.html (revision 416ba5c74546f32a993436a99516d35008e9f384)
19c2daa00SOllivier Robert<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
29c2daa00SOllivier Robert<html>
39c2daa00SOllivier Robert<head>
4ea906c41SOllivier Robert<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
59c2daa00SOllivier Robert<meta name="generator" content="HTML Tidy, see www.w3.org">
69c2daa00SOllivier Robert<title>tickadj - set time-related kernel variables</title>
79c2daa00SOllivier Robert<link href="scripts/style.css" type="text/css" rel="stylesheet">
89c2daa00SOllivier Robert</head>
99c2daa00SOllivier Robert<body>
109c2daa00SOllivier Robert<h3><tt>tickadj</tt> - set time-related kernel variables</h3>
11*2b15cb3dSCy Schubert<p>Last update:
12*2b15cb3dSCy Schubert  <!-- #BeginDate format:En2m -->10-Mar-2014  05:24<!-- #EndDate -->
13*2b15cb3dSCy Schubert    UTC</p>
149c2daa00SOllivier Robert<hr>
159c2daa00SOllivier Robert<h4>Synopsis</h4>
169c2daa00SOllivier Robert<tt>tickadj [ -Aqs ] [ -a <i>tickadj</i> ] [ -t <i>tick</i> ]</tt>
179c2daa00SOllivier Robert<h4>Description</h4>
18*2b15cb3dSCy Schubert<p>The <tt>tickadj</tt> program reads, and optionally modifies, several timekeeping-related variables in older kernels that do not have support for precision timekeeping, including HP-UX, SunOS, Ultrix, SGI and probably others. Those machines provide means to patch the kernel <tt>/dev/kmem</tt>. Newer machines with kernel time support, including Solaris, Tru64, FreeBSD and Linux, should NOT use the program, even if it appears to work, as it will destabilize the kernel time support. Use the <a href="ntptime.html"><tt>ntptime</tt></a> program instead.</p>
19*2b15cb3dSCy Schubert<p>The particular variables that can be changed with <tt>tickadj</tt> include <tt>tick</tt>, which is the number of microseconds added to the system time for a clock interrupt, <tt>tickadj</tt>, which sets the slew rate and resolution used by the <tt>adjtime</tt> system call, and <tt>dosynctodr</tt>, which indicates to the kernels on some machines whether they should internally adjust the system clock to keep it in line with time-of-day clock or not.</p>
209c2daa00SOllivier Robert<p>By default, with no arguments, <tt>tickadj</tt> reads the variables of interest in the kernel and displays them. At the same time, it determines an &quot;optimal&quot; value for the value of the <tt>tickadj</tt> variable if the intent is to run the <tt>ntpd</tt> Network Time Protocol (NTP) daemon, and prints this as well. Since the operation of <tt>tickadj</tt> when reading the kernel mimics the operation of similar parts of the <tt>ntpd</tt> program fairly closely, this can be useful when debugging problems with <tt>ntpd</tt>.</p>
219c2daa00SOllivier Robert<p>Note that <tt>tickadj</tt> should be run with some caution when being used for the first time on different types of machines. The operations which <tt>tickadj</tt> tries to perform are not guaranteed to work on all Unix machines and may in rare cases cause the kernel to crash.</p>
229c2daa00SOllivier Robert<h4>Command Line Options</h4>
239c2daa00SOllivier Robert<dl>
24*2b15cb3dSCy Schubert  <dt><tt>-a <i>tickadj</i></tt></dt>
25*2b15cb3dSCy Schubert  <dd>Set the kernel variable <tt>tickadj</tt> to the value <i><tt>tickadj specified.</tt></i></dd>
26*2b15cb3dSCy Schubert  <dt><tt>-A</tt></dt>
27*2b15cb3dSCy Schubert  <dd>Set the kernel variable <tt>tickadj</tt> to an internally computed &quot;optimal&quot; value.</dd>
28*2b15cb3dSCy Schubert  <dt><tt>-t <i>tick</i></tt></dt>
29*2b15cb3dSCy Schubert  <dd>Set the kernel variable <tt>tick</tt> to the value <i><tt>tick</tt></i> specified.</dd>
30*2b15cb3dSCy Schubert  <dt><tt>-s</tt></dt>
31*2b15cb3dSCy Schubert  <dd>Set the kernel variable <tt>dosynctodr</tt> to zero, which disables the hardware time-of-year clock, a prerequisite for running the <tt>ntpd</tt> daemon under SunOS 4.x.</dd>
32*2b15cb3dSCy Schubert  <dt><tt>-q</tt></dt>
33*2b15cb3dSCy Schubert  <dd>Normally, <tt>tickadj</tt> is quite verbose about what it is doing. The <tt>-q</tt> flag tells it to shut up about everything except errors.</dd>
349c2daa00SOllivier Robert</dl>
359c2daa00SOllivier Robert<h4>Files</h4>
36*2b15cb3dSCy Schubert<tt>/vmunix<br>
37*2b15cb3dSCy Schubert/unix<br>
38*2b15cb3dSCy Schubert/dev/kmem<br>
39*2b15cb3dSCy Schubert</tt>
409c2daa00SOllivier Robert<h4>Bugs</h4>
419c2daa00SOllivier RobertFiddling with kernel variables at run time as a part of ordinary operations is a hideous practice which is only necessary to make up for deficiencies in the implementation of <tt>adjtime</tt> in many kernels and/or brokenness of the system clock in some vendors' kernels. It would be much better if the kernels were fixed and the <tt>tickadj</tt> program went away.
429c2daa00SOllivier Robert<hr>
439c2daa00SOllivier Robert<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
449c2daa00SOllivier Robert</body>
459c2daa00SOllivier Robert</html>
46