Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am using Ubuntu 10.04 and use puppet to change the timezone from UTC to PST when the server comes up. Puppet's timezone recipe which I am using is this: Puppet Time Recipe

Things were working fine with Ubuntu 10.04, now we are moving to Ubuntu 12.04 and this Puppet recipe doesn't work. Reason I figured out is in 10.04 /etc/localtime is a file with contents PST8PDT whereas in 12.04 it is a symlink(because of puppet recipe) and it is linked to SystemV/ but the path of SystemV directory is not correct. When I do a ls -l in /etc

lrwxrwxrwx 1 root root 18 Oct 18 18:38 localtime -> ../SystemV/PST8PDT

But there is no SystemV folder one level up of /etc. I changed the puppet recipe to this:

class timezone::pacific inherits timezone {
file { "/etc/localtime":
    require => Package["tzdata"],
 #   source => "file:///usr/share/zoneinfo/US/Pacific",
    source => "file:///usr/share/zoneinfo/SystemV/PST8PDT",

and it worked and localtime was no longer a link. Can anyone please help me understand why the puppet recipe which I inherited and was working fine on 10.04 didnt work on 12.04 and why changing the recipe to the new SystemV destination fixed it .

share|improve this question

1 Answer 1

It is a bit odd. On my 12.04 VM both /usr/share/zoneinfo/SystemV/PST8PDT and /usr/share/zoneinfo/US/Pacific are a symlink to /usr/share/zoneinfo/America/Los_Angeles. Either path you used should have resulted in a /etc/localtime which was a link to ../America/Los_Angeles.

Have you considered doing a links => follow? That way puppet would resolve the symlink and copy the contents instead of copying the symlink.

share|improve this answer
    
Hmmm....interesting....On my Ubuntu 12.04.4 LTS VM, /etc/localtime is a file and not a symlink. I installed this VM from scratch using the Ubuntu "official" DVD. The same for the SystemV PST8PDT file. –  mdpc Oct 18 '12 at 19:09
    
@mdpc, right but he is trying to update the localtime with puppet, which I believe will copy a symlink and not follow it. Since he is pointing at a symlink he is getting a copy of that relative symlink in a place that is broken. –  Zoredache Oct 18 '12 at 19:10
    
One more piece of information which might be helpful, I am doing this on Amazon cloud instance and the ami I am using is ami-057bcf6c –  APZ Oct 18 '12 at 19:19
    
I also noticed that in 12.04 /usr/share/zoneinfo/US/Pacific is a link to SystemV/PST8PDT but in 10.04 /usr/share/zoneinfo/US/Pacific doent link to any file. –  APZ Oct 18 '12 at 19:23
    
@Zoredache I tried links=>follow in the puppet recipe with source => "file:///usr/share/zoneinfo/US/Pacific", I noticed that localtime file was not a symlink but had UTC0 as the content. –  APZ Oct 18 '12 at 19:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.