Coder Social home page Coder Social logo

Comments (7)

geerlingguy avatar geerlingguy commented on May 12, 2024

Huh... TIL Debian works with timezones slightly different than RHEL (and, unless I'm missing something, different than pretty much all other distros?): https://wiki.debian.org/TimeZoneChanges

Debian wants the user to run dpkg-reconfigure tzdata to use a UI to select a TZ.

And it looks like it definitely has an effect on Java SDKs (http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-August/020229.html), and possibly cron (though I can't find definitive documentation for this). But most other things rely on /etc/localtime only...

I'm trying to figure out why Debian doesn't seem to follow the general standard here, and what the real difference between the two files is, before blindly just changing both files to the same value (in case there be dragons).

from ansible-role-ntp.

geerlingguy avatar geerlingguy commented on May 12, 2024

Also from this answer, it looks like the best way to set this non-interactively is:

echo "Europe/Zurich" > /etc/timezone 
dpkg-reconfigure -f noninteractive tzdata

from ansible-role-ntp.

gforcada avatar gforcada commented on May 12, 2024

I noticed that because jenkins (created with geerlingguy.jenkins of course, thanks a lot for all these awesome ansible roles btw!!) was showing a different timezone than expected.

So at least for java in general or jenkins in particular it has some effects.

from ansible-role-ntp.

geerlingguy avatar geerlingguy commented on May 12, 2024

Yeah, it seems since Jenkins uses Java, it inherits the strange (to me) use of /etc/timezone instead of /etc/localtime for the default TZ data (from here):

  1. If TZ environment variable is set, use that.
  2. If /etc/timezone is readable, read the time zone from there.
  3. If /etc/localtime is a symlink, resolve that, and use the name to guess the time zone.
  4. Scan /usr/share/zoneinfo for a file whose contents match the contents of /etc/localtime.

from ansible-role-ntp.

geerlingguy avatar geerlingguy commented on May 12, 2024

And it looks like on Debian systems, /etc/timezone is present, and as you mentioned, since it's not managed by this role, Java's not getting the configured timezone.

I'm testing a fix locally.

from ansible-role-ntp.

geerlingguy avatar geerlingguy commented on May 12, 2024

I've pushed up a fix. If tests pass I'll tag a new release—it only makes this change/addition on Debian systems.

from ansible-role-ntp.

gforcada avatar gforcada commented on May 12, 2024

Thanks!

from ansible-role-ntp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.