PackagingDrafts/UsersAndGroupsThoughts

From FedoraProject

Jump to: navigation, search

Thoughts about user and group handling in packages

This is a collection of notes posted by various people in the user and group handling packaging draft, kept around for future reference. This is not a policy nor should the notes be interpreted as guidelines!

Here's a collection of past notes made regarding the issue. Some are taken into account in the above, some are not, some are more useful than others. These are not part of the actual draft, at least yet. Approach with care.

---

1. Before submitting the package for review, add the user to PackageUserRegistry, set the 'Under Review' field and fill in the other ones. Use a consecutive number for the 'hint' field. Rationale::

1. Make sure that package is not part of a Base installation; there is no simple way for administrators to install a local user policy during the initial rpm transaction

1. Add something like
%global username	<username>
%global hint		<hint>
%global homedir		%_var/lib/%username

Requires(pre):		/usr/sbin/useradd #/usr/sbin/groupadd
Requires(postun):	/usr/sbin/userdel #/usr/sbin/groupdel

Provides:		user(%username)	 = %hint
Provides:		group(%username) = %hint

%pre
id '%username' || /usr/sbin/useradd -r -d %homedir -s /sbin/nologin -c '...' %username || :

%postun
test "$1" = 0 || /usr/sbin/userdel %username
to your spec file.

Rationale::

Requires(pre): user(foobar) Requires(pre): group(foobar)

%files %attr(-,foobar,foobar) %_var/lib/foobar/data</pre>

TODO::

user-/groupname Purpose Packages Under Review command line
123 foo The user who is running the 'foo' service foo Y (#246788) -r -d /var/lib/foo -s /sbin/nologin -c 'Foo User'


Some random related recent posts: http://www.redhat.com/archives/fedora-packaging/2006-December/msg00066.html, http://www.redhat.com/archives/fedora-maintainers/2007-February/msg00328.html