| Main index | Section 8 | 日本語 | Options |
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:
| | |
|
This form handles system startups and shutdowns.
The
adjkerntz
utility is invoked with this option from
/etc/rc
on entry to multi-user mode, before any other daemons have been started.
The
adjkerntz
utility puts itself into the background.
Then, for a local time CMOS clock,
adjkerntz
reads the local time from it
and sets the kernel clock to the corresponding UTC time.
The
adjkerntz
utility also stores the local time zone offset in the
machdep.adjkerntz
kernel variable, for use by subsequent invocations of
'adjkerntz -a'
and by local time file systems.
For a local time CMOS 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 CMOS clock, if necessary, to ensure that it reflects the current local time zone. Then adjkerntz exits. | |
| | |
|
This form is used to update the local time CMOS clock and kernel
machdep.adjkerntz
variable when time zone changes occur,
e.g., when entering or leaving daylight savings time.
The
adjkerntz
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.
It stores the new offset into the
machdep.adjkerntz
kernel variable and updates the wall CMOS 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
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
| |
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.
| TZ | Time zone change rule, see tzset(3); not needed when tzsetup(8) or zic(8) is used. |
| /etc/localtime | Current zoneinfo file, see tzsetup(8) and zic(8). |
| /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. | |
| ADJKERNTZ (8) | March 8, 2012 |
| Main index | Section 8 | 日本語 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | Never write it in C if you can do it in `awk'; Never do it in `awk' if `sed' can handle it; Never use `sed' when `tr' can do the job; Never invoke `tr' when `cat' is sufficient; Avoid using `cat' whenever possible. |
” |
| — Taylor's Laws of Programming | ||