1 .\" Copyright (C) 1993-1998 by Andrey A. Chernov, Moscow, Russia.
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
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.
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
25 .\" $FreeBSD: src/sbin/adjkerntz/adjkerntz.8,v 1.18.2.5 2002/08/21 18:58:00 trhodes Exp $
26 .\" $DragonFly: src/sbin/adjkerntz/adjkerntz.8,v 1.5 2007/07/14 21:48:15 swildner Exp $
33 .Nd "adjust local time CMOS clock to reflect time zone changes and keep current timezone offset for the kernel"
42 utility maintains the proper relationship between the kernel clock, which
43 is always set to UTC, and the CMOS clock, which may be set to local
47 utility also informs the kernel about machine timezone shifts to
48 maintain proper timestamps for local time file systems such as the MS-DOS
50 The main purpose of this thing is not general fixing of
51 initially broken MS-DOS file timestamp idea but keeping
52 the same timestamps between
55 and MS-DOS operating system installed on the same
58 .Pa /etc/wall_cmos_clock
59 exists, it means that CMOS clock keeps local time (MS-DOS and MS-Windows
61 If that file does not exist, it means that the CMOS clock keeps UTC time.
64 utility passes this state to the
65 .Va machdep.wall_cmos_clock
68 Adjustments may be needed at system startup and shutdown, and
69 whenever a time zone change occurs.
70 To handle these different situations,
72 is invoked in two ways:
75 This form handles system startups and shutdowns.
78 utility is invoked with this option from
80 on entry to multi-user mode, before any other daemons have been started.
83 utility puts itself into the background.
84 Then, for a local time CMOS clock,
86 reads the local time from it
87 and sets the kernel clock to the corresponding UTC time.
90 utility also stores the local time zone offset into the
92 kernel variable, for use by subsequent invocations of
94 and by local time file systems.
96 For a local time CMOS clock
98 pauses, and remains inactive as a background daemon until it
100 The SIGTERM will normally be sent by
102 when the system leaves multi-user mode (usually, because the system
104 After receiving the SIGTERM,
106 reads the UTC kernel clock and updates the CMOS clock, if necessary,
107 to ensure that it reflects the current local time zone.
112 This form is used to update the local time CMOS clock and kernel
113 .Va machdep.adjkerntz
114 variable when time zone changes occur,
115 e.g., when entering or leaving daylight savings time.
118 utility uses the kernel clock's UTC time,
119 the previously stored
120 time zone offset, and the changed time zone rule to
121 calculate a new time zone offset.
122 It stores the new offset into the
123 .Va machdep.adjkerntz
124 kernel variable, and updates the wall CMOS clock to the new local time.
127 was started at a nonexistent time (during a timezone change), it exits
128 with a warning diagnostic unless the
130 option was used, in which case
132 sleeps 30 minutes and tries again.
134 This form should be invoked from root's
136 every half hour between midnight and 5am, when most modern time
138 Warning: don't use the
142 command line, or multiple
144 instances could conflict with each other.
149 utility clears the kernel timezone structure and makes the kernel clock run
150 in the UTC time zone.
151 Super-user privileges are required for all operations.
155 Time zone change rule, see
164 .Bl -tag -width /etc/wall_cmos_clock -compact
165 .It Pa /etc/localtime
166 Current zoneinfo file, see
170 .It Pa /etc/wall_cmos_clock
172 Its presence indicates that the machine's CMOS clock is set to local
173 time, while its absence indicates a UTC CMOS clock.
179 logs an error message via
181 and exits with a nonzero return code.
196 .An Andrey A. Chernov Aq ache@astral.msk.su