ADJKERNTZ(8)
π ADJKERNTZ(8) β ok bestie, let's talk about your clock
So this is a page from the System Manager's Manual section 8, and it's about adjkerntz, a little utility that keeps your clocks from fumbling each other. Strap in π
β¨ NAME β¨
adjkerntz β adjust real-time clock (rtc) and kernel timezone offset. That's it, that's the whole vibe β¨
π¦ SYNOPSIS π¦
adjkerntz -i
adjkerntz -a [-s]
πΈ DESCRIPTION πΈ
okay so. The adjkerntz utility maintains the proper relationship between the kernel clock β which is always set to UTC, no exceptions, that's just the rules β and the real-time clock, which may be set to local time. The adjkerntz utility also informs the kernel about machine timezone shifts so it can maintain proper timestamps for local time file systems such as the MS-DOS file system. π«Ά
And the main purpose of keeping these timestamps proper is to keep the timestamps of a FreeBSD MS-DOS file system and an MS-DOS operating system synchronized when they're installed on the same system β not to fix broken MS-DOS file timestamps, bestie, read carefully. π
Now, the file /etc/wall_cmos_clock β if it exists, it means the real-time clock keeps local time (MS-DOS and MS-Windows compatible mode). If that file does not exist, it means the real-time clock keeps UTC time. The adjkerntz utility passes this state to the machdep.wall_cmos_clock kernel variable. Slay.
Adjustments may be needed at system startup and shutdown, and whenever a time zone change occurs. To handle these different situations, adjkerntz is invoked in two ways:
-iβ this form handles system startups and shutdowns. Theadjkerntzutility is invoked with this option from/etc/rcon entry to multi-user mode, before any other daemons have been started. Theadjkerntzutility puts itself into the background. Then, for a local time real-time clock,adjkerntzreads the local time from it and sets the kernel clock to the corresponding UTC time. Theadjkerntzutility also stores the local time zone offset in themachdep.adjkerntzkernel variable, for use by subsequent invocations ofadjkerntz -aand by local time file systems.
For a local time real-time clock, adjkerntz -i pauses and remains inactive as a background daemon until it receives a SIGTERM. The SIGTERM will normally be sent by init(8) when the system leaves multi-user mode (usually, because the system is being shut down). After receiving the SIGTERM, adjkerntz reads the UTC kernel clock and updates the real-time clock, if necessary, to ensure that it reflects the current local time zone. Then adjkerntz exits. Iconic behavior, honestly. π
-a [-s]β this form is used to update the local time real-time clock andmachdep.adjkerntzkernel variable when time zone changes occur, e.g., when entering or leaving daylight savings time. Theadjkerntzutility 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. It stores the new offset into themachdep.adjkerntzkernel variable and updates the wall real-time clock to the new local time.
If adjkerntz -a was started at a nonexistent time (during a timezone change), it exits with a warning diagnostic unless the -s option was used, in which case adjkerntz sleeps 30 minutes and tries again. π΄
This form should be invoked from root's crontab(5) every half hour between midnight and 5am, when most modern time zone changes occur. Warning: do not use the -s option in a crontab(5) command line, or multiple adjkerntz -a instances could conflict with each other. fr fr, danger vibes π
The adjkerntz 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. No super-user, no service. π
π§ ENVIRONMENT π§
TZβ time zone change rule, seetzset(3); not needed whentzsetup(8)orzic(8)is used.
π FILES π
/etc/localtimeβ current zoneinfo file, seetzsetup(8)andzic(8)./etc/wall_cmos_clockβ empty file. Its presence indicates that the machine's real-time clock is set to local time, while its absence indicates a UTC real-time clock.
π DIAGNOSTICS π
No diagnostics. If an error occurs, adjkerntz logs an error message via syslog(3) and exits with a nonzero return code. Super lowkey about it, honestly. π€«
π SEE ALSO π
tzset(3), crontab(5), mount_msdosfs(8), ntpd(8), rc(8), sysctl(8), tzsetup(8), zic(8)
β HISTORY β
The adjkerntz utility appeared in FreeBSD 1.0. A true elder, a founding mother, we stan. π
π AUTHORS π
Andrey A. Chernov <ache@astral.msk.su>
and that's the whole page bestie!! π written from the Debian edition, dated July 29, 2024 β go forth and let your clocks be correct, no cap π¦
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π the page's license: BSD-2-Clause
- Copyright (c) 1993-1998 by Andrey A. Chernov, Moscow, Russia
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms