[systemd-devel] [PATCH] timedated: gather timezone from /etc/localtime sym target

Frederic Crozat fcrozat at suse.com
Tue Aug 14 05:54:58 PDT 2012


Le mardi 14 août 2012 à 11:20 +0200, Frederic Crozat a écrit :
> Le mercredi 08 août 2012 à 18:51 +0200, Lennart Poettering a écrit :
> > On Tue, 07.08.12 00:31, Shawn Landen (shawnlandden at gmail.com) wrote:
> > 
> > > keep other method for now, consider dropping later.
> > > 
> > > Supporting relative links here could be problematic as timezones in
> > > /usr/share/zoneinfo are often themselves symlinks (and symlinks to
> > > symlinks), so this implamentation only only support absolute links.
> > 
> > Hmm, I am not entirely sure this is really the best thing to do. Always
> > requiring a symlink for /etc/localtime breaks a couple of things: we
> > can't just bind mount things over in an nspawn container, embedded
> > devices have to ship /usr/share/zoneinfo/, which is probably something
> > they might want to avoid.
> > 
> > So, dunno, I think this is something to think about first, discuss the
> > pros and cons. I see that just having this as symlink is much simpler,
> > no doubt, but does it have more benefits? And possibly more
> > disadvantages?
> 
> Well, I just found a major disavantage: openSUSE (and YaST) are not
> using a symlink for /etc/localtime but a copy of the zoneinfo file (it
> is probably coming from support of separate /usr, when mounting /usr
> wasn't handled by initrd). So, this must be fixed to
> support /etc/localtime being a copy, at least for reading informations
> (currently, the code crashes, I'll see if I can fix it).

After discussing with other SUSE fellows (bnc#773491), I'd say we should
just ignore when /etc/localtime is a hardlink (or a copy) to a timezone
data (since we don't have the name of the timezone in the file itself)
and use /etc/sysconfig/clock as fallback (when available). And when
updating timezone, /etc/localtime should be created as a symlink.

-- 
Frederic Crozat <fcrozat at suse.com>
SUSE



More information about the systemd-devel mailing list