Should /etc/localtime
(under RHEL 5.3, not that I think it matters) be:
- a symlink to
/usr/share/zoneinfo/whatever
- a hard link to
/usr/share/zoneinfo/whatever
- a copy of
/usr/share/zoneinfo/whatever
I'd prefer 1) because it's explicit and easy to manage via Puppet but will it break anything? RedHat's default looks to be 3). Edit: I'm aware of the usual problems of symlinking across filesystems, tzdata updates, etc, but wasn't aware of the historical no-/usr-during-rc.sysinit gotcha. Thanks, all!
3 is the prefered method. This is due to an old bug that cause systems with a seperate /usr partition to set the system time to UTC since /usr/share/zoneinfo was not available during rc.sysinit. You can look it up at the following bugzilla
There is a reason for making a copy instead of symlink, for example if you have /usr on separate partition than / or /etc so there could be problems in some rare circumstances.
As was previously stated by others, it is just a safer standard to make it a copy of the file rather than a symlink (hard or soft). So much depends on the localtime file that having it broken can cause issues.
Also there are convenient utilities to handle this for you and should probably be your best course of time zone management for the system. Most linux systems will have
tzselect
available which will allow you to select the timezone you want the system to use and manage the localtime file for you without having to do so yourself. I would recommend using this tool unless you have reason not to.Different distributions handle this in different ways. I also prefer using symlinks, and that should make no difference at all.
The only possible problem you could encounter is that the original file changes path with an update and so the symlink breaks, but that's unlikely.
What I find annoying is that every time "tzdata" updates, it changes my timezone so I use 3) in conjunction with "chattr +i /etc/localtime"