Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Oct 2011 14:35:29 -0700
From:      Doug Barton <dougb@FreeBSD.org>
To:        Lev Serebryakov <lev@FreeBSD.org>
Cc:        arch@freebsd.org
Subject:   Re: /etc/localtime problems
Message-ID:  <4EADC321.4050409@FreeBSD.org>
In-Reply-To: <457576448.20111030151023@serebryakov.spb.ru>
References:  <457576448.20111030151023@serebryakov.spb.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4EADC321.4050409>