Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default timezone should be UTC #4

Closed
jclulow opened this issue Mar 18, 2023 · 1 comment · Fixed by #6
Closed

default timezone should be UTC #4

jclulow opened this issue Mar 18, 2023 · 1 comment · Fixed by #6
Assignees
Milestone

Comments

@jclulow
Copy link
Collaborator

jclulow commented Mar 18, 2023

The root file system for an omicron1-brand zone begins with the contents of the baseline archive. This archive is constructed either at startup on a developer workstation, or at ramdisk image build time for production machines. In both cases, we ship stock files from the original OS packages, including for the /etc/default/init. This file defines the system timezone, which is set by default to Pacific time for historical reasons:

$ cd /tmp

$ tar xvfz /usr/lib/brand/omicron1/baseline/files.tar.gz root/etc/default/init
Decompressing '/usr/lib/brand/omicron1/baseline/files.tar.gz' with '/usr/bin/gzcat'...
x root/etc/default/init, 1235 bytes, 3 tape blocks

$ cat root/etc/default/init
#
# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License").  You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# This file is /etc/default/init.
# This file looks like a shell script, but it is not.
#
# Lines of this file should be of the form VAR=value, where VAR is one of
# TZ, LANG, CMASK, or any of the LC_* environment variables.  value may
# be enclosed in double quotes (") or single quotes (').
STATE CHANGE: running -> completed
#
TZ=PST8PDT
CMASK=022

As part of baseline construction, we should replace the contents of this file with one that specifies TZ=UTC so that all zones operate with our expected timezone.

@jclulow jclulow added this to the MVP milestone Mar 18, 2023
@jclulow jclulow self-assigned this Mar 18, 2023
citrus-it added a commit to oxidecomputer/omicron that referenced this issue Apr 12, 2023
(PST within the zones notwithstanding, see
oxidecomputer/helios-omicron-brand#4)

This change rewrites the user accounting databases for all running zones
(including the GZ) once time is synchronised. It uses the
`/usr/platform/oxide/bin/tmpx` command which is available in very recent
stlouis. If that's missing, it will just carry on regardless, leaving
the
system uptime showing 13k days as before.

```
{"msg":"Timesync for [fd00:1122:3344:101::1]:12345 TimeSync { sync: false, skew: 0.0, correction: 0.0 }","v":0,"name":"SledAgent","level":30,"time":"1986-12-28T00:15:45.669141687Z","hostname":"gimlet-sn06","pid":101256,"component":"RSS"}
{"msg":"Time is not yet synchronized","v":0,"name":"SledAgent","level":40,"time":"1986-12-28T00:15:45.669154267Z","hostname":"gimlet-sn06","pid":101256,"component":"RSS","error":"\"Time is synchronized on 0/1 sleds\""}
...
gimlet-sn06 # date; uptime
Sun Dec 28 00:26:49 UTC 1986
00:26:49    up 1 min(s),  2 users,  load average: 1.31, 1.54, 0.77
gimlet-sn06 # zlogin oxz_internal_dns 'date; uptime'
Sat Dec 27 16:27:07 PST 1986
16:27:07    up 1 min(s),  0 users,  load average: 0.00, 0.00, 0.00
...
{"msg":"Timesync for [fd00:1122:3344:101::1]:12345 TimeSync { sync: true, skew: 117.186, correction: 2.207e-5 }","v":0,"name":"SledAgent","level":30,"time":"2023-04-11T22:34:20.543455275Z","hostname":"gimlet-sn06","pid":101256,"component":"RSS"}
...
gimlet-sn06 # date; uptime
Tue Apr 11 23:28:19 UTC 2023
23:28:19    up 1 min(s),  2 users,  load average: 4.75, 2.14, 1.10
gimlet-sn06 # zlogin oxz_internal_dns 'date; uptime'
Tue Apr 11 16:28:23 PDT 2023
16:28:23    up 1 min(s),  0 users,  load average: 0.00, 0.00, 0.00
```
@askfongjojo askfongjojo modified the milestones: MVP, FCS May 19, 2023
@davepacheco
Copy link

While I know there's a ton of stuff going on right now, I'm hopeful this is an easy fix that we can get into FCS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants