Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run dpkg-reconfigure tzdata immediately #13

Open
mconigliaro opened this issue Sep 3, 2013 · 4 comments
Open

Run dpkg-reconfigure tzdata immediately #13

mconigliaro opened this issue Sep 3, 2013 · 4 comments

Comments

@mconigliaro
Copy link
Contributor

dpkg-reconfigure tzdata should be run :immediately after updating the data files. Otherwise if the Chef run fails for some other reason, the command will never be run, and the timezone will never actually be updated. This might not be an issue on Chef 11, but it is on Chef 10.

@glensc
Copy link
Contributor

glensc commented Nov 26, 2013

I noticed the notify fails to work on plduyou as well. i.e after this recipe run, 'date' shows still UTC even i have configured timezone. i'll test the :immediately if it fixes there!

@glensc
Copy link
Contributor

glensc commented Nov 26, 2013

here's how pld fails, and fails on chef 11 as well:

 rm -f  /etc/localtime  /etc/sysconfig/timezone 
# chef-client -o 'recipe[timezone-ii::pld]'
Starting Chef Client, version 11.6.2
...
Recipe: timezone-ii::pld
  * template[/etc/sysconfig/timezone] action create
    - create new file /etc/sysconfig/timezone
    - update content in file /etc/sysconfig/timezone from none to 20782f
        --- /etc/sysconfig/timezone     2013-11-26 22:12:23.128342406 +0000
        +++ /tmp/chef-rendered-template20131126-17385-yuw6en    2013-11-26 22:12:23.128342406 +0000
        @@ -0,0 +1,10 @@
        +# Time zone information.
        +
        +# Directory containing zone information files.
        +ZONE_INFO_DIR="/usr/share/zoneinfo"
        +
        +# Scheme you would like to use in your system.
        +ZONE_INFO_SCHEME="posix"
        +
        +# Name of the time zone for your system.
        +TIMEZONE="Europe/Tallinn"
    - change mode from '' to '0644'
    - change owner from '' to 'root'
    - change group from '' to 'root'

  * service[timezone] action nothing (skipped due to action :nothing)
  * service[timezone] action reload
    - reload service service[timezone]

Chef Client finished, 2 resources updated

# ls -l /etc/localtime /etc/sysconfig/timezone
ls: cannot access /etc/localtime: No such file or directory
-rw-r--r-- 1 root root 250 nov   26 22:12 /etc/sysconfig/timezone

# service timezone reload
Setting time zone information (Europe/Tallinn) .... [ DONE ]

# ls -l /etc/localtime /etc/sysconfig/timezone
-rw-r--r-- 1 root root 2175 okt   28 17:43 /etc/localtime
-rw-r--r-- 1 root root  250 nov   27 00:12 /etc/sysconfig/timezone

@glensc
Copy link
Contributor

glensc commented Nov 26, 2013

and :immediately did not fix in pld. it may be different problem

@timvisher
Copy link

@L2G I just lost a few days to debugging why my MySQL process was in UTC while other things were in EST. The reason is because it was started between when /etc/timezone was written and when dpkg-reconfigure was run. I can't think of any reason why this shouldn't be run immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants