void-runit icon indicating copy to clipboard operation
void-runit copied to clipboard

core-services/03-console-setup.sh: respect localtime hwclock

Open deepcube opened this issue 3 years ago • 0 comments

When TIMEZONE was unset or empty, the resulting empty TZ variable in the environment caused hwclock to set the timezone to UTC and ignore the value of /etc/localtime. Only set TZ when TIMEZONE is non-empty.

Thanks to quinq in #voidlinux for finding the root cause of the bug.

hwclock(8):

The system timezone is configured by the TZ environment variable
or the /etc/localtime file, as tzset(3) would interpret them.

tzset(3):

If the TZ variable does appear in the environment, but its value
is empty, or its value cannot be interpreted using any of the
formats specified below, then Coordinated Universal Time (UTC)
is used.

Fixes: 6394a10 (core-services/02-console-setup.sh: setup HARDWARECLOCK if set.)

deepcube avatar Sep 20 '21 18:09 deepcube