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

shawn shawnlandden at gmail.com
Tue Aug 14 10:12:38 PDT 2012


On Tue, 2012-08-14 at 11:20 +0200, Frederic Crozat wrote: 
> 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).
> 

This is because its trying to free() the initialized pointer t, after
readlink() returns EINVAL.
It just has to be initialized to NULL. I'll post a revised 2/3 in a sec.
Otherwise, its fallowing your recommendations. It is
creating /etc/localtime as an *absolute* too.

-- 
-Shawn Landden



More information about the systemd-devel mailing list