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

replicate global zone /etc/default/init in new zones #6

Merged
merged 1 commit into from
May 26, 2023
Merged

replicate global zone /etc/default/init in new zones #6

merged 1 commit into from
May 26, 2023

Conversation

citrus-it
Copy link
Contributor

@citrus-it citrus-it commented May 25, 2023

This change is a quick update to address #4 - fixes #4
The differing timezones between the GZ and an NGZ caused confusion during a recent debugging session.

This isn't the approach suggested in #4, instead we just copy the GZ's init file into the new zone after extracting the baseline archive, so that a new zone's timezone and umask match the GZ at the time of creation.

gimlet-sn06 # testzone
test: No such zone configured
Use 'create' to begin configuring a new zone.
A ZFS file system has been created for this zone.
INFO: omicron: installing zone test @ "/zones/test"...
INFO: omicron: replicating /usr tree...
INFO: omicron: replicating /lib tree...
INFO: omicron: replicating /sbin tree...
INFO: omicron: pruning SMF manifests...
INFO: omicron: pruning global-only files...
INFO: omicron: unpacking baseline archive...
INFO: omicron: copying /etc/default/init...
INFO: omicron: install complete, probably!
gimlet-sn06 # cat /zones/test/root/etc/default/init
#
# 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 (').
#
TZ=UTC
CMASK=022

@citrus-it citrus-it requested a review from jclulow May 25, 2023 10:41
Copy link
Collaborator

@jclulow jclulow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is more brittle than just including a static copy of the file we want at build time, but I also cannot immediately conceive of (for this file, at least) a way this is likely to go particularly wrong: if the TZ is anything other than UTC in the global zone, the sled is already demonstrably broken.

So, while I would prefer the static file, you're welcome to go ahead!

brand/src/bin/brand.rs Show resolved Hide resolved
@jclulow jclulow changed the title Replicate GZ /etc/default/init to new zones replicate global zone /etc/default/init in new zones May 25, 2023
@jclulow jclulow merged commit 8708293 into main May 26, 2023
@citrus-it citrus-it deleted the tz branch May 30, 2023 10:55
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 this pull request may close these issues.

default timezone should be UTC
2 participants