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

Date and Time: clarify localtime settings (TIMEZONE is required for localtime) #633

Open
bobertlo opened this issue Dec 23, 2021 · 2 comments

Comments

@bobertlo
Copy link
Contributor

There have been multiple reports in IRC about localtime settings not working.

I was able to get this working by setting BOTH /etc/localtime and TIMEZONE="US/Central" in rc.conf, while the comments in rc.conf imply that you should set either /etc/localtime (preferred) OR TIMEZONE.

I have not had my coffee yet and @Duncaen understands what is happening better than I do. I just want to make sure the issue is documented.

@Duncaen
Copy link
Member

Duncaen commented Dec 23, 2021

I'm not sure if we should document this or fix the script instead, TIMEZONE in /etc/rc.conf will link /etc/localtime on each boot, changing the timezone will require updating both if you don't want to reboot.
I generally prefer just having one place where the timezone is set and that is by linking /etc/localtime.

The issue is that tzset(3) defaults to utc if the TZ environment variable is set and empty, /etc/runit/core-services/03-console-setup.sh always sets TZ=$TIMEZONE when it runs hwclock if $HARDWARECLOCK is set.

@bobertlo
Copy link
Contributor Author

bobertlo commented Dec 23, 2021 via email

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

No branches or pull requests

2 participants