xref: /freebsd/sbin/adjkerntz/adjkerntz.8 (revision 17ee9d00bc1ae1e598c38f25826f861e4bc6c3ce)
1.\" Copyright (C) 1993 by Andrew A. Chernov, Moscow, Russia.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.Dd December 15, 1993
26.Dt ADJKERNTZ 8
27.Os FreeBSD
28.Sh NAME
29.Nm adjkerntz
30.Nd "adjusts the kernel time if the machine runs wall CMOS clock"
31.Sh SYNOPSIS
32.Nm adjkerntz
33.Fl i
34.Nm adjkerntz
35.Fl a
36.Sh DESCRIPTION
37.Nm Adjkerntz
38fixes kernel time (makes it UTC) using the current wall CMOS clock value,
39the current time zone rule and the kernel timezone value. The adjustment is
40enabled only if the file
41.Pa /etc/wall_cmos_clock
42exists, in other cases it is assumed that the machine runs UTC CMOS clock and
43.Nm adjkerntz
44does nothing.
45.Pp
46The adjustment is needed at boot stage and when a time zone
47change occurs, so
48.Nm adjkerntz
49can be called in two forms:
50.Bl -tag -width 4n
51.It Cm Fl i
52initialization call from
53.Pa /etc/rc
54(before any daemons are started).
55.Nm Adjkerntz
56makes the adjustment of kernel clock (CMOS clock not touched)
57and the initial time zone offset is stored into
58.Pa adjkerntz
59kernel variable
60for following subsequent
61.Nm "'adjkerntz -a'"
62calls. Then it goes to background pause which ends with SIGTERM.
63After receiving SIGTERM it acts like
64.Nm "'adjkerntz -a'"
65to insure that the CMOS clock reflects the current local time zone.
66.It Cm Fl a
67This form is needed, when time zone changes occur.
68.Nm Adjkerntz
69uses the previously stored
70time zone offset and the changed time zone rule to
71produce the new time zone offset, fix the CMOS clock
72(kernel clock not touched)
73and store the new
74offset into
75.Pa adjkerntz
76kernel variable
77too.
78It is recommended to use this form in root's
79.Xr crontab 5
80every half of a hour from 0am to 4am
81since this times matches most modern time zone changes.
82.El
83.Pp
84.Nm Adjkerntz
85clears the kernel timezone structure and makes kernel always run at UTC
86time zone.
87Super-user privilege is required for all operations.
88.Sh ENVIRONMENT
89.Bl -tag -width Fl
90.It Ev TZ
91Time zone change rule, see
92.Xr tzset 3 ;
93not needed when
94.Xr /usr/sbin/tzsetup
95or
96.Xr zic 8
97is used.
98.Sh FILES
99.Bl -tag -width /etc/wall_cmos_clock -compact
100.It Pa /etc/localtime
101Current zoneinfo file, see
102.Xr /usr/sbin/tzsetup
103and
104.Xr zic 8 .
105.It Pa /etc/wall_cmos_clock
106Empty file.
107Presence of it indicates that the machine runs wall CMOS clock,
108absence indicates UTC CMOS clock.
109.Sh SEE ALSO
110.Xr tzset 3 ,
111.Xr zic 8 ,
112.Xr rc 8 ,
113.Xr crontab 5 ,
114.Xr sysctl 8 ,
115.Xr /usr/sbin/tzsetup
116.Sh DIAGNOSTICS
117No diagnostics.
118If any error occurs, an error message printed via
119.Xr syslog 3
120and
121.Nm adjkerntz
122exits with return code greater than zero.
123.Sh AUTHOR
124Andrew A. Chernov <ache@astral.msk.su>
125.Sh HISTORY
126The
127.Nm adjkerntz
128command appeared in FreeBSD 1.0.1
129
130