[systemd-devel] [EXT] Re: Using timedatectl on a readonly rootfile system using mender

Shravan Singh shravan at bluesparq.com
Wed Sep 9 15:53:28 UTC 2020


Can we close this issue?
I have a solution that works. I will provide it to mender and hopefully
they will maintain it if not then I will be happy to maintain it.


On Wed, Sep 9, 2020 at 11:30 AM Lennart Poettering <lennart at poettering.net>
wrote:

> On Mi, 09.09.20 09:23, Colin Guthrie (gmane at colin.guthr.ie) wrote:
>
> > Alvin Šipraga wrote on 08/09/2020 22:54:
> > > Hi,
> > >
> > > On 9/8/20 4:12 PM, Colin Guthrie wrote:
> > >
> > >> 2. Set your /etc/ master image to make /etc/localtime to be a symlink
> to
> > >> /run/localtime and then ensure /run/localtime is a symlink to the
> > >> appropriate file in /usr during early boot (e.g. in initramfs). Then
> > >> when you want to to change the timezone, just update the /run/
> symlink.
> > > This might not work as expected - systemd sometimes assumes that
> > > /etc/localtime is a symlink into /usr/share/zoneinfo and will not
> > > understand double symlinks. See src/basic/time-util.c:get_timezone()
> for
> > > at least one example.
> >
> > But that really depends on what you define as "not work". Sure
> > timedatectl may not report correctly, but that shouldn't matter too much
> > if you're not using to query or update (the latter obviously won't work
> > anyway), but for the purposes of software *using* the timezone, I don't
> > tihnk anything will actually break.
>
> Actually, that's not quite true:
>
>
> https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/TVVXVO5HJGH5JOAWJJDJNA3BPBPPRS37/
>
> (This is a current thread on the fedora ML)
>
> glibc doesn't care what /etc/localtime is, but all code that wants to
> know the timezone name, i.e. a string like "Europe/Berlin" generally
> requires /etc/symlink to be a readable symlink.
>
> https://www.freedesktop.org/software/systemd/man/localtime.html
>
> Lennart
>
> --
> Lennart Poettering, Berlin
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20200909/bcc55879/attachment.htm>


More information about the systemd-devel mailing list