On Tue, Nov 11, 2014 at 01:57:40PM -0500, John Baldwin wrote: > On Monday, November 10, 2014 7:36:19 am Lev Serebryakov wrote: > > > > After changing timezones in Russia (with replacing /etc/localtime > > with new file), I found that cron works in "old" timezone till > > restart. And all other services do the same, but cron is most obvious > > here :) > > > > Looks like libc reads timezone only once and it could not be chamged > > for process without restart (which leads to, effectivly, restart of > > whole server). > > > > Is it known problem? I think, it should be fixed somehow. I > > understand, that re-check timezone file on each time-related call > > could be expensive, though :( > > In practice, timezone changes are very rare, so rechecking the file is > quite expensive to do. I think having to restart processes is fine for this.
For cron it seems like a neglegable cost as it has to check a file and a directory at each interval. For most other things it seems like a waste of resources to check. Even on systems like MacOS where this is solved better, lots of behavior is application dependent. For example, current versions of Omni Focus behave very oddly when the timezone changes underneath them. In practice you need to restart the application when timezones change (such as after a flight). Just making libc aware isn't a magic bullet. -- Brooks
Description: PGP signature