/etc/localtime problems
Doug Barton
dougb at FreeBSD.org
Sun Oct 30 21:36:08 UTC 2011
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/
-------------- next part --------------
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}"
More information about the freebsd-arch
mailing list