I have a software package that (I am told) has to read the TZ environment variable, and if that variable is not set it can cause dates/times to be incorrect. Not sure if it is doing its own offset calculations or what. It used to work on an IBM AIX platform, and now it's going to run on Ubuntu Linux 18.04 LTS.
From what I understand, Ubuntu does not have the TZ variable preset to any value. It instead uses the time zone that it finds in either /etc/localtime
or /etc/timezone
(not sure which, or both?).
My question is this... If this package indeed needs TZ to not be null or blank, what should be the best approach to setting that value?
One person suggested that we put the TZ in /etc/profile
, so it is set for every login. Another suggested that we should instead be reading it from some other file, such as just in the .profile
for the users accessing that software. My suggestion was to put the export TZ=???
into the environment file that exists for the software, which gets executed every time the software is started.
Anyone see any issues with which option gets selected? One situation I can think of is that if we place it in the /etc/profile
, it is like permanently overriding the default time zone setting for every account that logs on. This may not be a big deal as I think this system will be exclusively used with the software package that needs the TZ variable set. Just trying to see if there are any other caveats to consider. Things like how it might affect Java connections, that sort of thing.
0 Answers