Quoting from the bug report:
| The timezone is currently setup in chroot-script:timezone(), but
| that function only sets up /etc/localtime but not /etc/timezone.
| The problem is that you end up with one set to Europe/Vienna and
| the other set to Etc/UTC.
|
| This can greatly confuse the system, due to some libraries/tools
| parsing the former, and other the latter.
|
| So that function should probably also update /etc/timezone, with
| the TIMEZONE value.
So write the $TIMEZONE setting to /etc/timezone.
Closes: #904607
Thanks: Guillem Jover <gjover@sipwise.com>
# adjust timezone {{{
timezone() {
if [ -n "$TIMEZONE" ] ; then
# adjust timezone {{{
timezone() {
if [ -n "$TIMEZONE" ] ; then
- echo "Adjusting /etc/localtime"
- ln -sf "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime
+ echo "Adjusting /etc/localtime"
+ ln -sf "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime
+
+ echo "Setting /etc/timezone to $TIMEZONE"
+ printf '%s\n' "$TIMEZONE" > /etc/timezone
+
# Default: 'en_US:en'
# DEFAULT_LANGUAGE='en_US:en'
# Default: 'en_US:en'
# DEFAULT_LANGUAGE='en_US:en'
-# Use /usr/share/zoneinfo/$TIMEZONE for /etc/localtime.
+# Use /usr/share/zoneinfo/$TIMEZONE for /etc/localtime + set /etc/timezone.
# Default: 'Europe/Vienna'
# TIMEZONE='Europe/Vienna'
# Default: 'Europe/Vienna'
# TIMEZONE='Europe/Vienna'
process:
sshd:
running: true
process:
sshd:
running: true
+file:
+ /etc/timezone:
+ exists: true
+ contains: ["Europe/Vienna"]
+ /etc/localtime:
+ filetype: symlink
+ exists: true
+ linked-to: /usr/share/zoneinfo/Europe/Vienna