[aur-general] Assigning Numbers to User and Group

Alexander Duscheleit jinks at archlinux.us
Thu Oct 14 06:00:05 EDT 2010


On Thu, 14 Oct 2010 02:44:40 -0700
Steve Holmes <steve.holmes88 at gmail.com> wrote:

> On Thu, Oct 14, 2010 at 06:52:46AM +0100, Magnus Therning wrote:
> > Is it important that the UID/GID are well-known, i.e. are the same
> > on all systems, that would be the case if they are hardcoded
> > somewhere in the code?
> 
> The actual numeric values don't matter to me all that much.  From what
> I had seen in other scripts, I thought one had to know the numeric ID
> of a group to assign a user to it when doing the useradd command.  I
> can look into that further.
> 
> > If that isn't the case then just create the UID/GID as system
> > accounts instead.
> 
> Yeah, I wouldn't mind doing it that way.  I'll have to see what ways
> one can create users and specify the primary group without knowing the
> calculated numeric gid.
> 

You could use "useradd -r -U", which would create a group with
the same name as the user (this is usually the best way for
system-daemon users).

Or, if you want another groupname, use "groupadd -r" and then use
"useradd -r -g <groupname>" to create the user belonging to that group.

Perhaps it would be a good idea to write a .install prototype for this?
This question pops up every now an then, and I have seen quite some
wrong ways to handle user/group creation on the AUR.

-- 
  Jinks


More information about the aur-general mailing list