-
Notifications
You must be signed in to change notification settings - Fork 247
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
[RFC] dracut: add an ignition-sysusers service #1153
Conversation
This adds a new `ignition-sysusers` service, ordered in-between the `mount` and `files` stages. It takes care of creating system users/groups so that they can be referenced in configuration, and used by Ignition when setting ownership for filesystem entries.
Type=oneshot | ||
RemainAfterExit=yes | ||
EnvironmentFile=/run/ignition.env | ||
ExecStart=/usr/sbin/chroot /sysroot /bin/bash -c "mount proc /proc -t proc && /usr/bin/systemd-sysusers && umount /proc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few doubts I got while going through this:
- I think the on-disk results of this will need to be wired into existing selinux-relabeling signaling mechanisms, right?
- should this logic be better placed in a script file or in Go as part of Ignition?
- should sysusers and config-users handling be moved to a single dedicated Ignition stage?
- naming bikeshedding?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of literally chroot
ing, we should lift https://github.com/openshift/os/blob/e808d5f364aae2a846793a0d7af7be8cc886871d/overlay.d/05rhcos/usr/lib/dracut/modules.d/40rhcos-fips/rhcos-fips.sh#L97-L120 out of there and into e.g. a sysroot-bwrap
command we can just call.
I've built a custom image with this but excluding
and writing a file owned by |
Hmm, IMO this should live in distro glue instead (so for FCOS, in https://github.com/coreos/fedora-coreos-config). It makes Ignition less opinionated. And also, running sysusers (and tmpfiles too) from the initrd needs to mesh well with other OS services. (And it's likely OS builders want more control too on how those are called.) |
@jlebon thanks for the inputs, that's exactly the kind of feedback I was looking for. Does something like coreos/fedora-coreos-config#774 looks more aligned to what you had in mind? |
Closing in favor of coreos/fedora-coreos-config#774. |
This adds a new
ignition-sysusers
service, ordered in-betweenmount
andfiles
stages.It takes care of creating system users/groups so that they can
be referenced in configuration, and used by Ignition when
setting ownership for filesystem entries.
Fixes: coreos/fedora-coreos-tracker#457