Re: /etc/localtime problems
- From: Jilles Tjoelker <jilles@xxxxxxxx>
- Date: Sun, 30 Oct 2011 14:43:13 +0100
On Sun, Oct 30, 2011 at 03:10:23PM +0400, Lev Serebryakov wrote:
Now, /etc/localtime is copy of one of files from
/usr/share/zoneinfo. It is created at install time or with "tzsetup"
utility.
IMHO, it is bad practice. For example, Russia changed rules
(cancelled Winter Time). Ok, our database was updated properly
(r223629 and MFCes), but "make buildworld installworld && mergemaster"
doesn't touch /etc/localtime! So, every administrator of every FreeBSD
server in Russia needs not to forget to update this file manually.
It looks not good.
IMHO, /etc/localtime should be symlink (in such case "installworld"
or "freebsd-update" will fix problem), or "mergemaster" should know
about this file and update it too...
Recent tzsetup(8) (in 10.x, 9.x and recent 8.x but not in any release)
stores the choice in /var/db/zoneinfo, allowing "tzsetup -r" to install
the new version of the previous time zone. This happens automatically on
installworld, but for some reason not on freebsd-update install.
However, this only works if the new tzsetup(8) was run at least once to
select the time zone (there is no code to create /var/db/zoneinfo from
which /usr/share/zoneinfo file matches /etc/localtime).
Code to create /var/db/zoneinfo could be something like
if [ ! -s /var/db/zoneinfo ] && [ -s /etc/localtime ]; then
zone=$(cd /usr/share/zoneinfo && for z in */* */*/* *; do
if cmp -s "$z" /etc/localtime; then echo "$z"; break; fi done)
if [ -n "$zone" ]; then echo "$zone" >/var/db/zoneinfo; fi
fi
It should be run against the old /usr/share/zoneinfo and assumes the
/etc/localtime is up-to-date against that.
--
Jilles Tjoelker
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"
- References:
- /etc/localtime problems
- From: Lev Serebryakov
- /etc/localtime problems
- Prev by Date: Re: [PATCH] fadvise(2) system call
- Next by Date: Re: /etc/localtime problems
- Previous by thread: Re: /etc/localtime problems
- Next by thread: Re: /etc/localtime problems
- Index(es):
Relevant Pages
|