ADJKERNTZ(8)

NAME
adjkerntz - adjusts the kernel time if the machine runs wall CMOS clock

SYNOPSIS
adjkerntz -i
adjkerntz -a

DESCRIPTION
Adjkerntz fixes kernel time (makes it UTC) using the current wall CMOS clock value, the current time zone rule and the kernel timezone value. The adjustment is enabled only if the file /etc/wall_cmos_clock exists, in other cases it is assumed that the machine runs UTC CMOS clock and adjkerntz does nothing.

The adjustment is needed at boot stage and when a time zone change occurs, so adjkerntz can be called in two forms:

-i  initialization call from /etc/rc (before any daemons are started). Adjkerntz makes the adjustment of kernel clock (CMOS clock not touched) and the initial time zone offset is stored into adjkerntz kernel variable for following subsequent 'adjkerntz -a' calls. Then it goes to background pause which ends with SIGTERM. After receiving SIGTERM it acts like 'adjkerntz -a' to insure that the CMOS clock reflects the current local time zone.

-a  This form is needed, when time zone changes occur. Adjkerntz uses the previously stored time zone offset and the changed time zone rule to produce the new time zone offset, fix the CMOS clock (kernel clock not touched) and store the new offset into adjkerntz kernel variable too. It is recommended to use this form in root's crontab(5) every half of a hour from 0am to 4am since this times matches most modern time zone changes.

Adjkerntz clears the kernel timezone structure and makes kernel always run at UTC time zone. Super-user privilege is required for all operations.

ENVIRONMENT

TZ  Time zone change rule, see tzset(3); not needed when /usr/sbin/tzsetup or zic(8) is used.

FILES
/etc/localtime
    Current zoneinfo file, see /usr/sbin/tzsetup and zic(8).
/etc/wall_cmos_clock
    Empty file. Presence of it indicates that the machine runs wall CMOS clock, absence indicates UTC CMOS clock.

SEE ALSO
tzset(3), zic(8), rc(8), crontab(5), sysctl(8), /usr/sbin/tzsetup

DIAGNOSTICS
No diagnostics. If any error occurs, an error message printed via syslog(3) and adjkerntz exits with return code greater than zero.

AUTHOR
Andrew A. Chernov <ache@astral.msk.su>

HISTORY
The adjkerntz command appeared in FreeBSD 1.0.1