I’m trying to change the timezone on an Ignition 8.1.10 server. It is currently ‘America/Chicago’, but we want to fix it on CST year round. I’ve created a
/etc/localtime link to
/usr/share/zoneinfo/Etc/GMT+6 and this seems to work fine - MariaDB sees its time correctly.
However, Ignition still reports its timezone in the ‘Gateway/Timezone’ server tag as ‘America/Chicago’. Setting clients to the Gateway timezone results in them showing CDT, not CST. Restarting Ignition and rebooting the server has had no effect. I’m concerned gateway scripts are going to trigger at the wrong time.
Does anyone know where the timezone of the server is set?
You can force the timezone by setting
-Duser.timezone in ignition.conf, but it might be best to figure out why the JVM on your system isn’t picking up the change you made…
What distro, what version of Ignition/Java, and do you already have a timezone being set in ignition.conf by chance?
Distro is Debian 10.11
Ignition is 8.1.10
Java is built-in Azul 11.0.11
No timezone is being set in ignition.conf as far as I can see. I can force clients to ‘Etc/GMT+6’ but the server timezone is still reported as ‘America/Chicago’.
I’m having trouble finding concrete documentation on how the JVM looks up the timezone on Linux, but I did find this somewhere:
- JVM uses the environment variable TZ if it is set.
- If TZ is not set, then JVM looks for the file /etc/sysconfig/clock and finds the ZONE entry.
- If neither TZ nor ZONE is set, JVM compares the contents of /etc/localtime to the files in /usr/share/zoneinfo looking for a match. The matching path and filename under /usr/share/zoneinfo provides the time zone.
/etc/localtime . If it is a soft link(ex:
/usr/share/zoneinfo/Asia/Shanghai ), return timezone by path. Otherwise, compare the content with all files in
/usr/share/zoneinfo , if found, return timezone.
GMT as timezone.
/etc/timezone may take precedence over
/etc/localtime, might check that.
Spot on Kevin, it looks like
/etc/timezone does indeed take precedence over
/etc/localtime for the JVM. When I changed that to ‘Etc/GMT+6’ and restarted Ignition it all looks to be working fine.
Thanks for your help!