[systemd-devel] [EXT] Re: Using timedatectl on a readonly rootfile system using mender
Andrei Borzenkov
arvidjaar at gmail.com
Sat Sep 12 06:06:51 UTC 2020
09.09.2020 00:54, Alvin Šipraga пишет:
> 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.
>
> It's not too difficult to work around and I can provide a patch if
> anybody wants it, although I don't think it will safely deal with
> circular symlinks.
Just add /var/state/tz (or any other suitable directory) to the
directory prefix list. The result is is not even needed to be symlink.
More information about the systemd-devel
mailing list