-
Notifications
You must be signed in to change notification settings - Fork 401
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
Run systemd-sysusers when generating initrd #1830
Comments
I think it's a good proposal. |
Such a patch would then have to use the systemd sysusers files that we are shipping with our modules ( and being shipped with modules that reside outside our own repository ) not anything that resides on the host system itself since there is no guarantee that those files exist there in the first place. |
Quite frankly I'm not seeing how such a patch will not end up being more of a mess then just keeping things as they are ( with the cons it has ) since in the end of the day we serve plethora of systemd based distribution which are in various stages of implementation of systemd in them ( Debian vs Arch for example ) as well as we also need to make sure that dracut ( and it's modules ) for none systemd based distro's behave the same ( void, gentoo, debian as well etc. ) which requires the none systemd based modules to generate the users/groups in the same manner ( equivalent to how systemd does it ). |
I think you misunderstood my proposal. I want all dracut modules to copy their dropins to initrd (as they do now) and then just call systemd-sysusers at the end on them (not the host's ones).
There is literally no difference between the current state and my proposal. Right now we gather the dropins into the initrd and generate the users on every boot. I am just saying, that this is redundant since you can do it just once when initrd is created. |
And also to back up my proposal. In a normal system we have ConditionNeedsUpdate just because we need to run the service when etc or usr change. Those are static in initrd. |
Yup completely misunderstood you proposal and your proposal has now a solid go from me. |
When generating the initrd, dracut copies all the sysusers dropins provided by its modules to it, and systemd-sysusers runs at every boot to always create the same users. This patch is intended to create the system users only when the initrd is generated, without including the systemd-sysusers stuff in the initrd, as it is not necessary. To control this functionality and allow to use the old method, added the `create_sysusers` configuration option (default to yes) and the `--no-create-sysusers` parameter. Fixes dracutdevs#1830
When generating the initrd, dracut copies all the sysusers dropins provided by its modules to it, and systemd-sysusers runs at every boot to always create the same users (`ConditionNeedsUpdate` removed in dracutdevs#1658). This patch is intended to create the system users only when the initrd is generated, without including the systemd-sysusers stuff in the initrd, as it is not necessary. To control this functionality and allow to use the old method, added the `create_sysusers` configuration option (default to yes) and the `--no-create-sysusers` parameter. Fixes dracutdevs#1830
I was looking at #1658 where we removed the Condition, so the sysusers are run every time in the initrd. I don't think this is necessary since we always take the same sysusers drop-ins and create the same users every time.
I think it should be safe to call systemd-sysusers while generating the initrd. We will move the module to the end of the queue and use systemd-sysusers --root.
This should result in smaller initrd (no need for sysusers binary in the initrd) and faster boot (no need to create the users every time).
I am willing to write a patch for this, but first, I want to check what others think.
The text was updated successfully, but these errors were encountered: