2009-08-26 17:13:45     ntp timezone

Document created by Aaronwu Employee on Aug 18, 2013
Version 1Show Document
  • View in full screen mode

2009-08-26 17:13:45     ntp timezone

Rob Maris (GERMANY)

Message: 79241   


From the Blackfin Asterisk PBX forum, same topic title, I quote this text:


CONFIG_LIB_UC_LIBC_TIMEZONE is supposed to affect the uC-libc library (which we do not have in the dist nor support). the simpleinit package cheats and also keys off of this. it's a lame of way of keeping from moving the behavior into the C library (which is what uClibc allows you to do).


the default build of uClibc enables support for timezones (via the POSIX TZ environment variable), but it does not enable support for the /etc/tz file. if you rebuild uClibc with UCLIBC_HAS_TZ_FILE enabled, you will get the expected behavior: set it in /etc/tz and applications will read it automatically rather than needing the environment variable.


if you dont rebuild uClibc, you will need to force the TZ variable into the environment of any applications you care about. perhaps the simpleinit hack is OK for your system. exporting variables in /etc/rc will only affect applications started up in /etc/rc. since it is a child of simpleinit, it obviously will have no affect on any other child of simpleinit. if you want the variable set in your shell logins, you should use /etc/profile as documented in the wiki.




Actually (using a quite recent trunk version), I encounter the problem that cron jobs do not perceive any local time, even if TZ=<localspec> is entered into the crontab).


As a workaround, I specify


export TZ=`cat /etc/TZ`


into the first line of my cron job file (which may call other scripts). Can anybody confirm if such a workaround is necessary or not?


And regarding the quoted text: it is from februarz 2008. Any update regarding uClibc support?




2009-08-26 17:20:30     Re: ntp timezone

Mike Frysinger (UNITED STATES)

Message: 79242   


whether your crontab supports setting env vars depends entirely on your crontab implementation. the crontab spec does not cover this kind of thing.


i dont know what kind of "update" you're looking for.  this isnt broken behavior.  uClibc is behaving exactly as it is configured to behave.




2009-08-26 17:32:13     Re: ntp timezone

Rob Maris (GERMANY)

Message: 79244   


What kind of update? I meant whether or not current uclibc toolchain has been built for TZ file set, while offering proper behaviour. I'd prefer not to have to provide TZ variable definitions on several places.


Regarding the crontab implementation: I have selected the busybox crontab, not the vixiecron option (Busybox 1.13.4). Mike, do you know about the behaviour of the vixiecron option resp. a newer busybox implementation? If not, I'll try it out and share it.






2009-08-26 17:42:00     Re: ntp timezone

Mike Frysinger (UNITED STATES)

Message: 79245   


the UCLIBC_HAS_TZ_FILE option is not enabled because no one has asked for it.  as for having to set it in the environment in multiple places, that has nothing to do with uClibc.


reading the source code of the busybox crond indicates that it does not parse env vars from the config file.  i imagine a patch to add a config option and support for it would be accepted upstream.