Description of problem: "mrtg.cfg" contains "Timezone[target]: Earth/Place". When generating output HTML document, MRTG ignores timezone in date/time. When calling rateup, timezone correctly used inside graph. Library /usr/lib/mrtg2/MRTG_lib.pm contains "datestr" sub. This sub is called out of "writehtml". "perl -d" shows, that before entering "localtime()" $ENV{TZ} contains different timezone, than system's one. But localtime() returns time, converted with system's /etc/localtime. "strace" shows, that file "/etc/localtime" is opened. Code cut to test perl program shows, that in normal case TZ= is used. "strace" shows, that file "/usr/share/zoneinfo/Earth/Place" is opened. Version-Release number of selected component (if applicable): mrtg-2.10.15-1 How reproducible: Every time Steps to Reproduce: 1. Use cfgmaker to produce simple interface config 2. Add Timezone[target]: Asia/Novosibirsk 3. Add "pngdate" to list of target options 4. Invoke MRTG "/usr/bin/mrtg <cfg>" 5. Take a lookup on output HTML in browser. Actual results: "The statistics were last updated" part has system's localtime. PNG picture has different time. Expected results: "The statistics were last updated" part must have the same time representation as on PNG picture. Additional info: Problem may be 1) in mrtg, garbaging memory 2) in perl-lib, not putting TZ=Earth/Place in libc's envp[]
After a fresh installation, there is no such bug in MRTG. This bug appears after "prelink" has been run.
Reproduced here (rawhide mrtg-2.1.11-1). Does the bug really not occur after a fresh installation, when the system timezone is different from the mrtg-configured timezone?
Created attachment 111550 [details] Call tzset () when changing $ENV{'TZ'} The attached patch was sent upstream. (I'm almost sure prelink has nothing to do with this.)
Fixed in mrtg-2.1.11-3, which should appear in rawhide after FC4t1 is released. Thanks for your report.