Bug #5768
closedDocument how to configure your timezone in rudder webapp
Description
On some JRE's (seen with at least the standard Oracle one, installed using the Linux x86_64 RPM on SLES11 SP1), Java uses a default timezone which is America/Los Angeles if no TZ variable is defined.
It completely f*cks up the "Last seen" date shown on the node details pane (they are shown relative the the JRE timezone)
From webapp logs:
[2014-11-12 17:13:48] INFO application - registered property: user.country="US" [2014-11-12 17:13:48] INFO application - registered property: user.language="en" [2014-11-12 17:13:48] INFO application - registered property: user.timezone="America/Los Angeles"
I suspect that system OpenJDK packages on other system set the default TZ without anything to do.
We should make sure that the timezone Java uses is the same as the system one, and change it accordingly.
I am not yet sure if it should be done on the packaging side (init scripts) or directly Rudder webapp side...
FAR, any advice ?
WORKAROUND¶
Edit /etc/default/rudder-jetty and add:
JAVA_OPTIONS="-Duser.timezone=Europe/Paris"
Updated by Matthieu CERDA about 10 years ago
Note, workaround is to edit /opt/rudder/etc/rudder-jetty.conf and add:
JAVA_OPTIONS="$JAVA_OPTIONS -Duser.timezone=Europe/Paris -Duser.country=FR -Duser.language=fr"
Updated by Jonathan CLARKE about 10 years ago
This may well be related to #4708.
Updated by François ARMAND about 10 years ago
Humpf. My advice is that such JVM should be burned :(
More seriously, what we might do is to add a check when rudder start to get the system TZ and set it explicitly. Or it could be a parameter for the init script, that if let empty will look at the current timezone and use it (TZ env variable, or /etc/timezone - I think, but not sure what is standard and more preciselly what are the convention (not agreing with standard) for each distro).
Updated by Matthieu CERDA about 10 years ago
I think this is just something I'd love to do, related to #5653: Adding thing kind of detection would create yet another patch on jetty's init script that would likely break other things because of its size (offsetting has its limits).
Maybe this is the right occasion to just use our own Jetty init script ?
Also, I suggest editing the jetty init script to implement several detection methods for this :)- TZ env var
- /etc/timezone
- /etc/localtime symlink
- ...
Updated by Janos Mattyasovszky about 8 years ago
Well, timezones are critical part of any system, that displays/deals with times (which does not?)...
You could have the system TZ set to UTC (as IT which has many all-around-the-globe Servers usually does) and only the per-user TZ set to the current local time of the user using it, so having it configurable via /etc/sysconfig/rudder
or /etc/default/rudder-jetty
would be very good in terms of basic usability
*Update:
It actually is configurable by setting JAVA_OPTIONS
inside /etc/default/rudder-jetty
, since the first does only append his stuff to this. Good to know.
I'd suggest to create a documentation of this in the installation section!
Updated by François ARMAND over 7 years ago
- Subject changed from Rudder should verify that the timezone given by java matches the system one to Bad "last seen" time when the timezone given by java does not matches the system one
- Severity set to Minor - inconvenience | misleading | easy workaround
- User visibility set to Getting started - demo | first install | level 1 Techniques
- Priority set to 0
Updated by Jonathan CLARKE over 7 years ago
- Status changed from Discussion to New
Updated by Benoît PECCATTE over 7 years ago
- Effort required set to Small
- Priority changed from 0 to 45
Updated by François ARMAND about 4 years ago
- Description updated (diff)
- Priority changed from 55 to 0
Updated by François ARMAND almost 3 years ago
- Subject changed from Bad "last seen" time when the timezone given by java does not matches the system one to Document how to configure your timezone in rudder webapp
- Category changed from Web - Nodes & inventories to Documentation
- Status changed from New to Resolved
It was added in documentation since then (and it's also documented in /etc/default/rudder-jetty)