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
32 .Nd adjust the local time CMOS clock to reflect time zone changes and keep the current timezone offset for the kernel
41 utility maintains the proper relationship between the kernel clock, which
42 is always set to UTC and the CMOS clock, which may be set to local time.
45 utility also informs the kernel about machine timezone shifts in order to
46 maintain proper timestamps for local time file systems such as the MS-DOS
48 The main purpose of maintaining these timestamps properly is to keep the
51 MS-DOS file system and an MS-DOS operating system synchronized when they are
52 installed on the same system rather than fixing broken MS-DOS file
55 .Pa /etc/wall_cmos_clock
56 exists, it means that the CMOS clock keeps local time (MS-DOS and MS-Windows
58 If that file does not exist, it means that the CMOS clock keeps UTC time.
61 utility passes this state to the
62 .Pa machdep.wall_cmos_clock
65 Adjustments may be needed at system startup and shutdown, and
66 whenever a time zone change occurs.
67 To handle these different situations,
69 is invoked in two ways:
72 This form handles system startups and shutdowns.
75 utility is invoked with this option from
77 on entry to multi-user mode, before any other daemons have been started.
80 utility puts itself into the background.
81 Then, for a local time CMOS clock,
83 reads the local time from it
84 and sets the kernel clock to the corresponding UTC time.
87 utility also stores the local time zone offset in the
89 kernel variable, for use by subsequent invocations of
91 and by local time file systems.
93 For a local time CMOS clock
95 pauses and remains inactive as a background daemon until it
97 The SIGTERM will normally be sent by
99 when the system leaves multi-user mode (usually, because the system
101 After receiving the SIGTERM,
103 reads the UTC kernel clock and updates the CMOS clock, if necessary,
104 to ensure that it reflects the current local time zone.
109 This form is used to update the local time CMOS clock and kernel
110 .Pa machdep.adjkerntz
111 variable when time zone changes occur,
112 e.g., when entering or leaving daylight savings time.
115 utility uses the kernel clock's UTC time,
116 the previously stored
117 time zone offset, and the changed time zone rule to
118 calculate a new time zone offset.
119 It stores the new offset into the
120 .Pa machdep.adjkerntz
121 kernel variable and updates the wall CMOS clock to the new local time.
124 was started at a nonexistent time (during a timezone change), it exits
125 with a warning diagnostic unless the
127 option was used, in which case
129 sleeps 30 minutes and tries again.
131 This form should be invoked from root's
133 every half hour between midnight and 5am, when most modern time
135 Warning: do not use the
139 command line, or multiple
141 instances could conflict with each other.
146 utility clears the kernel timezone structure and makes the kernel clock run
147 in the UTC time zone.
148 Super-user privileges are required for all operations.
152 Time zone change rule, see
161 .Bl -tag -width /etc/wall_cmos_clock -compact
162 .It Pa /etc/localtime
163 Current zoneinfo file, see
167 .It Pa /etc/wall_cmos_clock
169 Its presence indicates that the machine's CMOS clock is set to local
170 time, while its absence indicates a UTC CMOS clock.
176 logs an error message via
178 and exits with a nonzero return code.
182 .Xr mount_msdosfs 8 ,
193 .An Andrey A. Chernov Aq Mt ache@astral.msk.su