In order to get some more transparency in the process, I'm opening this ticket to track the work that @wwoods, @harald and myself are doing to improve the way that we create users and groups in RPM spec files. For the moment, this ticket is informative, not actionable. We want to keep people in the loop (and get feedback), but we will state it clearly in this ticket later when there is something to be voted on.
To summarize the problems we have today (in no particular order):
To this end, we are looking to make a one-time mass package update to replace all of the disparate implementations of user-creation with a set of macros that will implement the user and group creation as LUA.
These macros are being designed to be (eventually) multi-purpose; thus they will have a prefix of %osbuild_. This is to leave open the door to using them to handle other common RPM setup activities as well. At present, we're looking at the following macros for use:
%osbuild_
%osbuild_groupadd [-S subpackagename | -n packagename]
groupadd
%osbuild_pre
%osbuild_install
%osbuild_files
-S
-n
%package
%osbuild_useradd [-S subpackagename | -n packagename]
useradd
%osbuild_pre [-S subpackagename | -n packagename]
%pre
%osbuild_useradd
%osbuild_groupadd
%osbuild_install [-S subpackagename | -n packagename]
%install
%osbuild_files [-S subpackagename | -n packagename]
%files
A sample specfile in this format can be viewed on Github: https://github.com/fabrix/osbuild/blob/master/test/test.spec
The implementation of these macros is still a work-in-progress, but is viewable at https://github.com/fabrix/osbuild
Metadata Update from @churchyard: - Issue assigned to sgallagh - Issue priority set to: None (was: Needs Review)
Thank you @sgallagh. I've assigned the ticket to you to show that there is no action needed from the FPC yet. Thanks for the nice and detailed summary.
Generally I agree with the high level goal, as for the details of provided macros, I'll need more time to give you some feedback. Probably after devconf (after this weekend). Feel free to locate me on devconf and discuss this in person if you'd like, I'll be on the Fedora/Python/PyLadies multi-booth.
I'm a bit confused here... Why are we doing this instead of using the sysusers stuff that was added for us?
Also, this looks really similar to the rpm-helper stuff that Mageia and OpenMandriva have. Perhaps there's an opportunity to learn from that and try to avoid the pitfalls of those implementations (and maybe have them collaborate on this too?)
rpm-helper
cc: @akien
I'll ping @harald to answer this part because I forget the details, but I think it turned out that the macros had some flaws in them. This implementation will use sysusers under the hood, but it's a more generic framework.
Also, this looks really similar to the rpm-helper stuff that Mageia and OpenMandriva have. Perhaps there's an opportunity to learn from that and try to avoid the pitfalls of those implementations (and maybe have them collaborate on this too?) cc: @akien
Could you point at some resources on rpm-helper?
There's a Git repo: http://gitweb.mageia.org/software/rpm/rpm-helper/about/
Its usage is kind of detailed here: https://wiki.mageia.org/en/Packagers_RPM_tutorial#More_macros
@akien may know more, as he's been a Mageia packager longer than I have...
@sgallagh There's also another tool like this (though with slightly different focus and scope) from Solus called usysconf that allowed them to mostly ban package scripts entirely.
Login to comment on this ticket.