Skip to content

image: populate /etc/project on gimlet #146

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions image/templates/files/project
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
system:0::::
user.root:1::::
noproject:2::::
default:3::::
group.staff:10::::
omicron:100:The Oxide Control Plane:::
Copy link
Contributor

Choose a reason for hiding this comment

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

A few questions:

  • How did we pick the starting ID of 100?
  • Do we want to keep the default additions to /etc/project?
  • Should we be putting this in the template file at build time or is there something we should be doing to make sure that this is created at system start up time as part of some SMF service that's delivered by Omicron? I'm not against the cross-consolidation dep here, just trying to think out loud about this. I guess in theory it makes sense to do this. I guess the project file itself is committed so it's not so bad.
  • How do you see us using projects longer term? I realize each zone has its own project database (I think!) and that'll end up being unique. We have many different services in the global zone that are part of the control plane writ large and not just sled agent. Is this really specific to sled agent or would we put maghemite and related in the same project?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should pick globally unique IDs, and probably start at a higher number like 200000.

I think it's expedient to wholesale pre-populate the file like this today, but in the limit we should be assembling this at zone install time (that is, the brand should be doing it) by combining a partial database from each zone image archive (of which there could be zero, one, or many) with the database from the baseline files in the ramdisk. There are some details to work out about that (e.g., how to deal with conflicts, etc), and it likely needs to cover several of the databases (e.g., not just project, but at least passwd, shadow, and group, as well) which is why I haven't gotten to that yet.

4 changes: 4 additions & 0 deletions image/templates/gimlet/ramdisk-02-trim.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@
"file": "/etc/motd",
"src": "motd",
"owner": "root", "group": "sys", "mode": "0644" },
{ "t": "ensure_file",
"file": "/etc/project",
"src": "project",
"owner": "root", "group": "sys", "mode": "0644" },

{ "t": "ensure_file",
"file": "/etc/system.d/zfs:dbuf",
Expand Down