Linux - EnterpriseThis forum is for all items relating to using Linux in the Enterprise.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Recently installed RHEL4u2 (2.6.9-37) onto all servers and nodes at a remote site -- the problem is when called localtime() within Time::Local for perl 5.8.5
The RHEL4u2 came with some perl updates, now inside a lot of scripts we had calls to localtime() from within the Time::Local module, then inside the same script we define TZ environment variable and call localtime() again, but it doesn't recognize the new TZ...this worked fine in RHEL3 and works fine on my machine (Fedora Core 6)... so it looks like something in the RHEL4u2 perl-*5.8.5*rpm caused this.
My question now is, does anyone know if RHEL4u2 for whatever reason has maybe localtime() linked to glibc's localtime_r() or vice versa...the only possible answer I can come up with is that tzset is being called before each localtime() call inside the scripts thus no matter what TZ is set to inside the script, the call before the localtime() call supersedes it....
I can't find anything on google, couldn't find anything in the forum, tried our RedHat support folks, but their answer is always to install the new rpm or update, but on a nation-wide system which requires a national baseline to interconnect we just can't do that on a whim, it takes an act of G-d to get the baseline changed.
Any help appreciate, and apologies if this is the wrong thread, or already answered 10^100 times
just in case anyone references this, the solution:
perl5-8-5 changed the calls to tzset glibc to be from perl localtime() to localtime_r() :: so localtime() no longer calls tzset but rather, localtime_r() calls tzset in perl no for RHEL distr --- you can call tzset before the localtime calls or just edit the scripts you use to have localtime_r() called simple enough
my $now = localtime;
print "Calling 'localtime' function without an TZ:\n";
print "\tThe time/date is: $now.\n";
call localtime_r() instead of localtime()
gotta admit I still use and love VI so I just did: