Re: Fwd: Re: [f16-branch] Write human readable timezone information to /etc/timezone.

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

 



On 09/21/2011 03:21 PM, Lennart Poettering wrote:
(Replying to a mailing list mail in a forwarding from Ales, sorry for that)

On 06.09.2011 08:29, Ales Kozumplik wrote:


-------- Original Message --------
Subject: Re: [f16-branch] Write human readable timezone information to
/etc/timezone.
Date: Wed, 31 Aug 2011 09:39:20 -0400
From: David Cantrell <dcantrell@xxxxxxxxxx>
Reply-To: Discussion of Development and Customization of the Red Hat
Linux Installer <anaconda-devel-list@xxxxxxxxxx>
Organization: Red Hat
To: anaconda-devel-list@xxxxxxxxxx

On 08/31/2011 06:52 AM, Ales Kozumplik wrote:
This is to unify this basic config file with other distros. systemd is
made to
maintain it in sync with /etc/localtime.

If systemd maintains the symlink, why can't it create it when it doesn't
exist? Systemd seems to be treating /etc/localtime as authoritative in
this case.

Symlink? There is no symlink.

My misunderstanding. "Maintain it in sync" made me assume it was just a symlink.

The new file /etc/timezone is a one line text file with the time zone
name. It has been used like this on Debian, Ubuntu, Gentoo. And that for
a very good reason: because otherwise getting a textual description for
the current zone is really messy, since you need to iterate through
/usr/share/zoneinfo and look for the file that is identical to
/etc/localtime. That is slow, fragile and massively IO intensive.

systemd whenever it changes /etc/localtime will also write /etc/timezone
to the right value. All I am asking here is that anaconda as the initial
tool that writes /etc/localtime does the same.

We already write that string to /etc/sysconfig/clock, which is shell syntax, but it's still there.

f = open(instPath + "/etc/adjtime", "w")
f.write(lines[0])
f.write(lines[1])

The problem I have with these sorts of patches are that anaconda now
owns the initial creation of this symlink. What happens when the
symlink has to move, change, or otherwise be modified in the future? I
guarantee you that the group making that decision will not communicate
it with us and we will deal with it in a reactive manner.

There is no symlink. And it won't move. We are just basically copying
here what Debian/Ubuntu/Gentoo have been doing for ages for a very good
reason. They didn't have to change the file in the last 10y or so, and I
see very little for us to make any similar changes. This isn't really
anything new. It's just following an established de-facto standard where
we were basically the only ones who didn't follow it.

This is very unlikely to change anytime soon.

I don't buy that. History has shown that things change in Linux a lot. Remember when everyone thought /sbin/init was a solved problem?

And even in the worst case: since /etc/localtime is authoritative the
effect of /etc/localtime and /etc/timezone being out of sync is minimal.
Configuration frontends might default to the wrong setting, but that's it.

Which would lead to a bad user experience. The possibility of the files being out of sync is real, in which case why should anyone ever trust the value in /etc/timezone?

So I always ask myself if anaconda really needs to own the creation of
this symlink or if it can be placed in another component?

It's no symlink. And the thing is that nobody else can fill in that file
efficiently since it requires iterating through /usr/share/zoneinfo. It
must be the tool which writes /etc/localtime that also writes
/etc/timezone. Since it has the right information anyway.

The bug indicates that systemd is pushing for common files like this to
avoid having applications scour /usr/share/zoneinfo to get a human
readable name for /etc/localtime. Why not have systemd just do that at
boot up?

It's an expensive IO-intensive operation, and we want to boot fast...
Doing that at every boot is ridiculous.

It's a trivial operation if everybody who writes /etc/localtime also
writes /etc/timezone at the same time. Most tools which are portable to
other distros do this already anyway. Anaconda currently doesn't, but it
would be great if it did. Like the Debian installer does, or the Ubuntu
one.
>
Note that a major reason to do this change is compatibility with other
distros, there's no need here that we cook our own soup, and distinguish
ourselves from Debian/Ubuntu/Gentoo.

I'm not advocating trying to maintain some level of distinction from other distributions. I really don't care what the other distributions do or don't do.

It's more efficient, more descriptive to write /etc/timezone whenever
you write /etc/localtime. It's also helps unifying the various Linux
platforms out there.

 > Will users know to update /etc/timezone when they update
/etc/localtime?

I am pretty sure the fewest people change that file manually, and
instead use some kind of tool for it. Since /etc/timezone is a de-facto
standard on many Linux distros most of those tools already know how to
write those files.

Actually, a lot of people touch that file manually. It's a file. Assume users will touch it.

In particular, since the Ubuntu/Debian userbase is bigger then ours it
will be easier and more obvious to understand this, especially for
newcomers.

That's not a compelling reason to make this change.

And again, even if the two files get out of sync, the effect won't be
that bad.

But it would be a little bad. This strikes me as one of those changes where we can't make a decision that please everyone. It's like picking a reasonable default size for /home during autopartitioning or what goes in to the default package selection....there's no way to actually make all users happy. So any change there gains you nothing. You just shift the displeasure to a different group of users.

 > Or will some users think they can change /etc/timezone
to change the timezone and leave /etc/localtime alone and then wonder
why things don't work?

Things will work, since only /etc/localtime is authoritative and is used
by the glibc. if /etc/timezone is out of sync the worst that happens is
that for example GNOME's tz configuration UI shows you out of date
timezone info.

So what component would own the bug report in that case?

 > Perhaps system-config-date could offer a Python
library, C library, and command line tool to look up /etc/localtime and
print out the human-readable name?

Nah. I am sorry. We don't need a library for this, especially since that
would be used on Fedora only and nowhere else.

But a tool that owns the synchronization of /etc/localtime and /etc/timezone should exist. Otherwise we get in to problems like we've had in the past with who owns changes to /etc/hosts, or /etc/resolv.conf, and so on.

In short, I do not think this is a thing anaconda should own.

It's nothing anaconda should "own". it's just a file that anaconda
should write, when writing /etc/localtime. The file is currently ghosted
and owned by systemd, but could be moved to setup.rpm or
filesystemd.rpm, too, doesn't really matter.

Based on your description, /etc/timezone is a file written by numerous components, so there's no primary owner. That's my concern.

So, please, here again the reasons why we want this:

- It makes querying the local timezone for presentation in configuration
tools easy and efficient at minimal IO. The previous way to determine it
was highly IO intensive and ugly to work for.

The time zone string is currently available in /etc/sysconfig/clock and has been for a very long time. How about systemd grabbing the string from that if /etc/timezone doesn't exist and writing it out?

- It's an accepted de-facto standard used on many other distros. Unifies
the Linux platforms.

- Already implemented in many tools that can set the timezone. Major
missing tool is basically Anaconda.

- Keeps our stack simple, since we need no complex algorithms,
libraries, or other complexities that need maintainance.

Please don't work against the unification of Linux.

Seriously?  Thanks, I appreciate that.

Here's what I would like to see with time and date stuff:

1) Do not put *more* code for time and date setting in to anaconda.
2) Build up s-c-date or some other tool that can centrally own whatever time and date stuff the distribution needs.
3) Stop creating more time and date files in /etc, I think we have enough.

--
David Cantrell <dcantrell@xxxxxxxxxx>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Westford, MA | EST5EDT

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux