Skip to content

Conversation

@deepcube
Copy link

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.)

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 deepcube changed the title core-services/03-console-setup.sh: respect localtime core-services/03-console-setup.sh: respect localtime hwclock Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant