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 first adjustment and the initial time zone offset is stored into
57.Pa adjkerntz
58kernel variable
59for following subsequent
60.Nm adjkerntz
61calls.
62.It Cm Fl a
63This form is needed, when time zone changes occur.
64.Nm Adjkerntz
65uses the previously stored
66time zone offset and the changed time zone rule to
67produce the new time zone offset, fix the RTC clock and store the new
68offset into
69.Pa adjkerntz
70kernel variable
71too.
72It is recommended to use this form in root's
73.Xr crontab 5
74every half of a hour from 0am to 4am
75since this times matches most modern time zone changes.
76.Pp
77.Nm Adjkerntz
78clears the kernel timezone structure and makes kernel always run at UTC
79time zone.
80Super-user privilege is required for all operations.
81.Sh ENVIRONMENT
82.Bl -tag -width Fl
83.It Ev TZ
84Time zone change rule, see
85.Xr tzset 3 ;
86not needed when
87.Xr /usr/sbin/tzsetup
88or
89.Xr zic 8
90is used.
91.Sh FILES
92.Bl -tag -width /etc/wall_cmos_clock -compact
93.It Pa /etc/localtime
94Current zoneinfo file, see
95.Xr /usr/sbin/tzsetup
96and
97.Xr zic 8 .
98.It Pa /etc/wall_cmos_clock
99Empty file.
100Presence of it indicates that the machine runs wall CMOS clock,
101absence indicates UTC CMOS clock.
102.Sh SEE ALSO
103.Xr tzset 3 ,
104.Xr zic 8 ,
105.Xr rc 8 ,
106.Xr crontab 5 ,
107.Xr sysctl 8 ,
108.Xr /usr/sbin/tzsetup
109.Sh DIAGNOSTICS
110No diagnostics.
111If any error occurs, an error message printed via
112.Xr syslog 3
113and
114.Nm adjkerntz
115exits with return code greater than zero.
116.Sh AUTHOR
117Andrew A. Chernov <ache@astral.msk.su>
118.Sh HISTORY
119The
120.Nm adjkerntz
121command appeared in FreeBSD 1.0.1
122
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 first adjustment and the initial time zone offset is stored into
57.Pa adjkerntz
58kernel variable
59for following subsequent
60.Nm adjkerntz
61calls.
62.It Cm Fl a
63This form is needed, when time zone changes occur.
64.Nm Adjkerntz
65uses the previously stored
66time zone offset and the changed time zone rule to
67produce the new time zone offset, fix the RTC clock and store the new
68offset into
69.Pa adjkerntz
70kernel variable
71too.
72It is recommended to use this form in root's
73.Xr crontab 5
74every half of a hour from 0am to 4am
75since this times matches most modern time zone changes.
76.Pp
77.Nm Adjkerntz
78clears the kernel timezone structure and makes kernel always run at UTC
79time zone.
80Super-user privilege is required for all operations.
81.Sh ENVIRONMENT
82.Bl -tag -width Fl
83.It Ev TZ
84Time zone change rule, see
85.Xr tzset 3 ;
86not needed when
87.Xr /usr/sbin/tzsetup
88or
89.Xr zic 8
90is used.
91.Sh FILES
92.Bl -tag -width /etc/wall_cmos_clock -compact
93.It Pa /etc/localtime
94Current zoneinfo file, see
95.Xr /usr/sbin/tzsetup
96and
97.Xr zic 8 .
98.It Pa /etc/wall_cmos_clock
99Empty file.
100Presence of it indicates that the machine runs wall CMOS clock,
101absence indicates UTC CMOS clock.
102.Sh SEE ALSO
103.Xr tzset 3 ,
104.Xr zic 8 ,
105.Xr rc 8 ,
106.Xr crontab 5 ,
107.Xr sysctl 8 ,
108.Xr /usr/sbin/tzsetup
109.Sh DIAGNOSTICS
110No diagnostics.
111If any error occurs, an error message printed via
112.Xr syslog 3
113and
114.Nm adjkerntz
115exits with return code greater than zero.
116.Sh AUTHOR
117Andrew A. Chernov <ache@astral.msk.su>
118.Sh HISTORY
119The
120.Nm adjkerntz
121command appeared in FreeBSD 1.0.1
122