Document how to configure your timezone in rudder webapp
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 ?
Edit /etc/default/rudder-jetty and add:
Updated by François ARMAND over 7 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 over 7 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/localtime symlink
Updated by Janos Mattyasovszky almost 6 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/default/rudder-jetty would be very good in terms of basic usability
It actually is configurable by setting
/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 about 5 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 François ARMAND 5 months 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)