1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-21 07:15:49 +00:00

adjkerntz.8: minor cleanup (markup, spdx, reflow)

+ real-time and rtc added to search keywords
- local dropped from search keywords
+ ntpd added to see also
+ use machine independent language

Reported by: emaste (MI language)
MFC after: 3 days
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1326
This commit is contained in:
Alexander Ziaee 2024-07-24 15:39:13 -04:00 committed by Warner Losh
parent a2b67d4a6e
commit ad57cea9e6

View File

@ -1,4 +1,7 @@
.\" Copyright (C) 1993-1998 by Andrey A. Chernov, Moscow, Russia.
.\"-
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 1993-1998 by Andrey A. Chernov, Moscow, Russia.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@ -22,12 +25,12 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd March 8, 2012
.Dd July 29, 2024
.Dt ADJKERNTZ 8
.Os
.Sh NAME
.Nm adjkerntz
.Nd adjust the local time CMOS clock to reflect time zone changes and keep the current timezone offset for the kernel
.Nd adjust real-time clock (rtc) and kernel timezone offset
.Sh SYNOPSIS
.Nm
.Fl i
@ -37,7 +40,7 @@
The
.Nm
utility maintains the proper relationship between the kernel clock, which
is always set to UTC and the CMOS clock, which may be set to local time.
is always set to UTC and the real-time clock, which may be set to local time.
The
.Nm
utility also informs the kernel about machine timezone shifts in order to
@ -51,13 +54,13 @@ installed on the same system rather than fixing broken MS-DOS file
timestamps.
If the file
.Pa /etc/wall_cmos_clock
exists, it means that the CMOS clock keeps local time (MS-DOS and MS-Windows
compatible mode).
If that file does not exist, it means that the CMOS clock keeps UTC time.
exists, it means that the real-time clock keeps local time
.Pq MS-DOS and MS-Windows compatible mode .
If that file does not exist, it means that the real-time clock keeps UTC time.
The
.Nm
utility passes this state to the
.Pa machdep.wall_cmos_clock
.Va machdep.wall_cmos_clock
kernel variable.
.Pp
Adjustments may be needed at system startup and shutdown, and
@ -65,7 +68,7 @@ whenever a time zone change occurs.
To handle these different situations,
.Nm
is invoked in two ways:
.Bl -tag -width 4n
.Bl -tag -width "-a [-s]"
.It Fl i
This form handles system startups and shutdowns.
The
@ -76,51 +79,51 @@ on entry to multi-user mode, before any other daemons have been started.
The
.Nm
utility puts itself into the background.
Then, for a local time CMOS clock,
Then, for a local time real-time clock,
.Nm
reads the local time from it
and sets the kernel clock to the corresponding UTC time.
The
.Nm
utility also stores the local time zone offset in the
.Pa machdep.adjkerntz
.Va machdep.adjkerntz
kernel variable, for use by subsequent invocations of
.Em "'adjkerntz -a'"
.Ql adjkerntz -a
and by local time file systems.
.Pp
For a local time CMOS clock
.Em "'adjkerntz -i'"
For a local time real-time clock
.Ql adjkerntz -i
pauses and remains inactive as a background daemon until it
receives a SIGTERM.
The SIGTERM will normally be sent by
.Xr init 8
when the system leaves multi-user mode (usually, because the system
is being shut down).
when the system leaves multi-user mode
.Pq usually, because the system is being shut down .
After receiving the SIGTERM,
.Nm
reads the UTC kernel clock and updates the CMOS clock, if necessary,
reads the UTC kernel clock and updates the real-time clock, if necessary,
to ensure that it reflects the current local time zone.
Then
.Nm
exits.
.It Fl a Op Fl s
This form is used to update the local time CMOS clock and kernel
.Pa machdep.adjkerntz
variable when time zone changes occur,
This form is used to update the local time real-time clock and
.Va machdep.adjkerntz
kernel variable when time zone changes occur,
e.g., when entering or leaving daylight savings time.
The
.Nm
utility uses the kernel clock's UTC time,
the previously stored
time zone offset, and the changed time zone rule to
calculate a new time zone offset.
the previously stored time zone offset,
and the changed time zone rule to calculate a new time zone offset.
It stores the new offset into the
.Pa machdep.adjkerntz
kernel variable and updates the wall CMOS clock to the new local time.
.Va machdep.adjkerntz
kernel variable and updates the wall real-time clock to the new local time.
If
.Em "'adjkerntz -a'"
was started at a nonexistent time (during a timezone change), it exits
with a warning diagnostic unless the
.Ql adjkerntz -a
was started at a nonexistent time
.Pq during a timezone change ,
it exits with a warning diagnostic unless the
.Fl s
option was used, in which case
.Nm
@ -128,14 +131,14 @@ sleeps 30 minutes and tries again.
.Pp
This form should be invoked from root's
.Xr crontab 5
every half hour between midnight and 5am, when most modern time
zone changes occur.
every half hour between midnight and 5am,
when most modern time zone changes occur.
Warning: do not use the
.Fl s
option in a
.Xr crontab 5
command line, or multiple
.Em "'adjkerntz -a'"
.Ql adjkerntz -a
instances could conflict with each other.
.El
.Pp
@ -145,7 +148,7 @@ utility clears the kernel timezone structure and makes the kernel clock run
in the UTC time zone.
Super-user privileges are required for all operations.
.Sh ENVIRONMENT
.Bl -tag -width Fl
.Bl -tag -width /etc/wall_cmos_clock
.It Ev TZ
Time zone change rule, see
.Xr tzset 3 ;
@ -164,8 +167,8 @@ and
.Xr zic 8 .
.It Pa /etc/wall_cmos_clock
Empty file.
Its presence indicates that the machine's CMOS clock is set to local
time, while its absence indicates a UTC CMOS clock.
Its presence indicates that the machine's real-time clock is set to local
time, while its absence indicates a UTC real-time clock.
.El
.Sh DIAGNOSTICS
No diagnostics.
@ -178,6 +181,7 @@ and exits with a nonzero return code.
.Xr tzset 3 ,
.Xr crontab 5 ,
.Xr mount_msdosfs 8 ,
.Xr ntpd 8 ,
.Xr rc 8 ,
.Xr sysctl 8 ,
.Xr tzsetup 8 ,