Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#12166 - rc scripts are affected by local TZ variable

Attached to Project: Arch Linux
Opened by Daniel Quinn (searchingfortao) - Tuesday, 18 November 2008, 00:23 GMT
Last edited by Hugo Doria (hdoria) - Saturday, 21 March 2009, 23:01 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Tobias Powalowski (tpowa)
Aaron Griffin (phrakture)
Thomas Bächler (brain0)
Architecture All
Severity Low
Priority Normal
Reported Version None
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Start up scripts appear to be affected by a locally set TZ variable. In other words, if root has her environment TZ set to "Canada/Pacific" and runs /etc/rc.d/http restart and then PHP scripts running out of Apache report the time in Pacific time, despite the fact that /etc/localtime is set to UTC.


Steps to reproduce:
# export TZ="Canada/Pacific"
# /etc/rc.d/http restart
(test the time on a PHP script)
# unset TZ
# /etc/rc.d/http restart
(test the time on a PHP script)

A sample PHP script to use:
<?
print date('Y-m-d H:i:s');
?>


Expected Behaviour:
Server daemons should always start in the system time.


Suggested fix:
The TIMEZONE variable in rc.conf could be renamed to TZ or some rc-script magic could go into setting TZ based on TIMZONE.
This task depends upon

Closed by  Hugo Doria (hdoria)
Saturday, 21 March 2009, 23:01 GMT
Reason for closing:  Fixed
Comment by Aaron Griffin (phrakture) - Thursday, 04 December 2008, 16:32 GMT
  • Field changed: Severity (Medium → Low)
This requires running as root. It's not really a big deal in the grand scheme of things.

As for renaming TIMEZONE to TZ... Thomas, what do you think?
Comment by Thomas Bächler (brain0) - Thursday, 04 December 2008, 17:24 GMT
I'd say, we just unset TZ somewhere in rc.functions or so.
Comment by Aaron Griffin (phrakture) - Thursday, 04 December 2008, 17:27 GMT
or maybe do an:
export TZ=$TIMEZONE ?
Comment by Thomas Bächler (brain0) - Thursday, 04 December 2008, 17:34 GMT
My point was, a daemon should always reflect whatever /etc/localtime says: IMO it makes more sense to unset TZ then.
Comment by Aaron Griffin (phrakture) - Thursday, 04 December 2008, 17:41 GMT Comment by Glenn Matthys (RedShift) - Friday, 05 December 2008, 14:48 GMT
Just a note, php has its own timezone settings in php.ini as well. Pay attention to that if you're testing with php.

Loading...