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

Bug#813226: tzdata config script ignores /etc/timezone on non-interactive configuration



On 2016-01-31 00:36, YAMADA Tsuyoshi wrote:
> Package: tzdata
> Version: 2016a-1
> Severity: minor
> 
> Dear Maintainer,
> 
> After tzdata 2016a-1, automated tzdata configuration with
> 
>   echo "Asia/Tokyo" > /etc/timezone
>   dpkg-reconfigure -fnoninteractive tzdata
> 
> does not work.
> 
> With tzdata 2015g-1, it works.
> 
>   root@a26eeeb7b8b7:~# date
>   Sat Jan 30 15:28:54 UTC 2016
>   root@a26eeeb7b8b7:~# echo Asia/Tokyo > /etc/timezone
>   root@a26eeeb7b8b7:~# dpkg-reconfigure -fnoninteractive tzdata
> 
>   Current default time zone: 'Asia/Tokyo'
>   Local time is now:      Sun Jan 31 00:29:12 JST 2016.
>   Universal Time is now:  Sat Jan 30 15:29:12 UTC 2016.
> 
>   root@a26eeeb7b8b7:~# date
>   Sun Jan 31 00:29:13 JST 2016
> 
> But with tzdata 2016a-1, it does not work well.
> 
>   root@fdc1139936e4:~# date
>   Sat Jan 30 15:30:00 UTC 2016
>   root@fdc1139936e4:~# echo Asia/Tokyo > /etc/timezone
>   root@fdc1139936e4:~# dpkg-reconfigure -fnoninteractive tzdata
> 
>   Current default time zone: 'Etc/UTC'
>   Local time is now:      Sat Jan 30 15:30:21 UTC 2016.
>   Universal Time is now:  Sat Jan 30 15:30:21 UTC 2016.
> 
>   root@fdc1139936e4:~# date
>   Sat Jan 30 15:30:23 UTC 2016
> 
> I have found a workaround, deleting /etc/localtime
> before running dpkg-reconfigure solves this problem.
> 
>   root@fdc1139936e4:~# date
>   Sat Jan 30 15:30:50 UTC 2016
>   root@fdc1139936e4:~# echo Asia/Tokyo > /etc/timezone
>   root@fdc1139936e4:~# rm /etc/localtime
>   root@fdc1139936e4:~# dpkg-reconfigure -fnoninteractive tzdata
> 
>   Current default time zone: 'Asia/Tokyo'
>   Local time is now:      Sun Jan 31 00:31:15 JST 2016.
>   Universal Time is now:  Sat Jan 30 15:31:15 UTC 2016.
> 
>   root@fdc1139936e4:~# date
>   Sun Jan 31 00:31:18 JST 2016
> 
> Is this bug of tzdata config script? Or expected behavior?

I don't think it is a bug. The correct way to configure the timezone has
always been to change /etc/localtime symlink, ie in your case by doing
"ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime". This is what
desktop environments do when changing the timezone and it is what
systemd expects.

Changing /etc/timezone worked in some cases before as we use to store
/etc/localtime as a copy of the file instead of a symlink when possible,
in order to allow the timezone to be correct without a /usr partition.
This is not needed anymore given /usr is now mount from the initramfs
when needed.

Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

Attachment: signature.asc
Description: PGP signature


Reply to: