From owner-freebsd-arch@FreeBSD.ORG Sun Oct 30 21:36:08 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 795CE106567D; Sun, 30 Oct 2011 21:36:08 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id D4B5E14F4C9; Sun, 30 Oct 2011 21:35:29 +0000 (UTC) Message-ID: <4EADC321.4050409@FreeBSD.org> Date: Sun, 30 Oct 2011 14:35:29 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111001 Thunderbird/7.0.1 MIME-Version: 1.0 To: Lev Serebryakov References: <457576448.20111030151023@serebryakov.spb.ru> In-Reply-To: <457576448.20111030151023@serebryakov.spb.ru> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: multipart/mixed; boundary="------------000607020809040905000505" Cc: arch@freebsd.org Subject: Re: /etc/localtime problems X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 21:36:08 -0000 This is a multi-part message in MIME format. --------------000607020809040905000505 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 10/30/2011 04:10, Lev Serebryakov wrote: > Hello, Arch. > > 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... Thanks for bringing this to our attention. The symlink is problematic both because of the possibility of /usr being mounted late, and also for single-user mode. What do you think of the attached patch? I think it will handle the situation. Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ --------------000607020809040905000505 Content-Type: text/plain; name="mm-tzsetup.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="mm-tzsetup.diff" Index: mergemaster.sh =================================================================== --- mergemaster.sh (revision 226748) +++ mergemaster.sh (working copy) @@ -1311,6 +1311,19 @@ esac echo '' +if [ -f /var/db/zoneinfo ]; then + echo "*** Reinstalling `cat /var/db/zoneinfo` as /etc/localtime" + tzsetup -r +else + echo "*** There is no /var/db/zoneinfo file to update /etc/localtime." + echo -n ' Would you like to run tzsetup? y or n [y] ' + read ANSWER + case "$ANSWER" in + y|'') tzsetup ;; + esac +fi + +echo '' if [ -r "${MM_EXIT_SCRIPT}" ]; then . "${MM_EXIT_SCRIPT}" --------------000607020809040905000505--