[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#816201: live-config: using tzdata component fails and always set to 'Etc/UTC'



Source: live-config
Version: 5.20151121
Severity: normal
Tags: patch

Dear Maintainer,

   * What led up to the situation?
While configuring the live-config.timezone parameter (on kernel boot parameter
or by config.conf file) to any value, hence 'Europe/Paris', the only result is
the 'Etc/UTC' timezone set.

   * What exactly did you do (or not do) that was effective (or
     ineffective)?
Looked up the '0070-tzdata' component source file and find that the process to
change timezone is:
 1/ echoing the timezone to the '/etc/timezone' file (ex: echo
"Europe/Paris">/etc/timezone )
 2/ call to the reconfiguration of tzdata package ( "dpkg-reconfigure -f
noninteractive -p critical tzdata" )

If I try to do the same thing by hand, I can se that:
 1/ echoing works fine (hopefully :) )
 2/ call to the tzdata package reconfiguration do not return any error, BUT the
'/etc/timezone' file content has been modified by the reconfiguration process.

I thought then the package tzdata was misconfigured or with errors. Looking up
the https://anonscm.debian.org/cgit/pkg-
glibc/tzdata.git/tree/debian/tzdata.config#n329 we can identify that the tzdata
configuration process override the '/etc/timezone' file if '/etc/localtime'
exists and is a symlink.
I really think I get something!

We may unlink '/etc/localtime' in
https://anonscm.debian.org/cgit/debian-live/live-
config.git/tree/components/0070-tzdata#n50
before calling 'dpkg-reconfigure ... tzdata'



-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.3.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
>From b10d7cf76929325741e51479099cc7d2a233f9c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9gory=20DAVID?= <groolot@groolot.net>
Date: Sun, 28 Feb 2016 15:32:16 +0100
Subject: [PATCH] Unlink /etc/localtime if exists before calling
 reconfiguration

---
 components/0070-tzdata | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/components/0070-tzdata b/components/0070-tzdata
index 2677c37..f0a338b 100755
--- a/components/0070-tzdata
+++ b/components/0070-tzdata
@@ -47,6 +47,9 @@ Config ()
 	fi
 
 	echo "${_AREA}/${_ZONE}" > /etc/timezone
+	if [ -L /etc/localtime ] ; then
+		unlink /etc/localtime
+	fi
 	dpkg-reconfigure -f noninteractive -p critical tzdata
 
 	# Creating state file
-- 
2.7.0


Reply to: