Replies: 6 comments
-
I will update the top post as a design document and add your answers and suggestions so they don't get lost in the discussion below. So the first questions to every one is: How does your distribution handle user and group creation? What features would you hope for and what issues solved? I am especially interested in what do people in more exotic places (like other OSs than Linux) do. |
Beta Was this translation helpful? Give feedback.
-
We can quite easily generate the user/group provide/requires from the C-side, it just needs to have a disabler. Or, maybe this could be an excuse to make the relevant info available to Lua which could then do this from a parametric generator. Breaking is a feature I think: this will simply force packages adding users or groups from their scriptlets to add manual provides for them, which will make things easier to track on a distro-level. |
Beta Was this translation helpful? Give feedback.
-
In openSUSE the FWIW mentioning this here for completeness, users and groups do not necessarily need to be created in %pre stage in all cases. For transactional systems that only update the os in /usr and apply any potential data and config migrations at boot, users would also get created at boot only. |
Beta Was this translation helpful? Give feedback.
-
Quick note: "m" lines in the |
Beta Was this translation helpful? Give feedback.
-
See #2432 |
Beta Was this translation helpful? Give feedback.
-
User/group handling was implemented in #2432, documentation at https://rpm-software-management.github.io/rpm/manual/users_and_groups.html Closing this discussion to avoid folks getting confused over all the speculated variants in here, lets open a new discussion (and/or tickets of course) around what was implemented if necessary. |
Beta Was this translation helpful? Give feedback.
-
Currently the creation of users and groups are left to the packagers and is though done differently between different distribution and as %pre scriptlets. This has several drawbacks:
Because of this we are looking for a more declarative way of handling users and groups. They are part of the core business of rpm (putting files on disk) but are currently treated as an secondary, accidental detail of the OS. (Initial ticket without much info: #1032)
Current implementations
Inside RPM
Setting user and group of files
In packages
Distributions
We collect the implementation details and requirements from different distributions here, to be able to come up with a solution that will
work for everybody. Please add the details of your distribution in the discussion and I will add it to this document.
Fedora
setup
package ships/etc/passwd
and friends with 13 system accountsOpenSUSE
Your Distribution
Challenges and Requirements
useradd --root
different one
scriptlets is too messy
Solutions
There is currently no final decision on how to implement this feature. So here are some parts and pieces:
installation of the system
We basically need 3 separate pieces:
useradd
andgroupadd
looks like a viable optionSolution
After prototyping, looking at the bits and pieces that are already in use and discussions we are currently at the following solution:
Provides:
to store user and group data.user($USERNAME) = base64encoded systemd-sysusers line
orgroup($GROUPNAME) = base64encoded systemd-sysusers line
systemd-sysusers
(this may be replaced with a script usinguseradd
/groupadd
in distributions not shipping systemdsysuser-tools
will create those provides automatically formsysuser.d
filesBenefits of this approach is that the changes to rpm are relatively small and only a few pieces needs to be added to the rpm code implementation. It also is similar to what (some) distributions have already be doing and builds on that. Provides with the user and group syntax not matching this pattern will be ignored. So current packages should not change behavior as long as they are not rebuild with the new dependency generator enabled.
Keeping large parts of the implementation in helper scripts and macros keeps it easy for distributions to adjust it too their needs and style of user and group handling.
In a second step we can add
Requires:
to use the user and group information for ordering.Beta Was this translation helpful? Give feedback.
All reactions