Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

None yet

1 participant