YIO-Remote / remote-os

💎 Buildroot OS for YIO remote
GNU General Public License v3.0
13 stars 9 forks source link

Timezone is no longer persisted due to read-only root file system #78

Closed zehnm closed 3 years ago

zehnm commented 3 years ago

Description

After introducing the read-only root file system, the timezone can no longer be set with timedatectl set-timezone.

How to Reproduce

Steps to reproduce the behavior:

  1. Log in by ssh
  2. Set a new timezone, e.g.: timedatectl set-timezone UTC
  3. Reboot remote
  4. Check timezone with date: back to CEST

Expected behavior

Timezone can be set and is persisted during reboots.

Your Environment

Additional context

The /etc file system overlay is only an in-memory overlay which is not persisted during reboots.

zehnm commented 3 years ago

My current understanding: timedatectl is a systemd utility, which requires /etc/localtime to be a symlink to the timezone information. The /etc/timezone file is mostly a "Debian thing". Setting a new timezone with timedatectl only sets a new symlink and leaves /etc/localtime untouched. More information:

Options:

zehnm commented 3 years ago

Setting the TZ variable in /opt/yio/app-launch.sh works fine. I think this is the easiest way to make the timezone user configurable with a read-only root filesystem and leaving systemd untouched.

Alternatively a profile.d entry with a bind-mount could be used.