[aur-general] Prefered way to create users/groups and handle files ownership

Nowaker enwukaer at gmail.com
Sat Jan 25 10:03:11 EST 2014


What is the prefered way of creating users/groups and handling files 
ownership for AUR packages?

My take is to change the file ownership (`chown`) in .install script. 
That's what I do in the PKGBUILDs I write myself.

However, inspircd, which I adopted a few months ago takes a different 
approach. The previous maintainer hardcoded a UID and GID directly in 
the package:

install -o141 -g141 -dm750 "${pkgdir}/var/log/inspircd"

getent group inspircd &>/dev/null || groupadd -r -g 141 inspircd
getent passwd inspircd &>/dev/null || useradd -r -u 141 -g inspircd -d 
/var/lib/inspircd -s /bin/false inspircdl

I don't like this approach - what if the user has already assigned UID 
141 to other user? Then effectively inspircd and, say, Apache, are 
running under the same user. But maybe there is some reason behind this 
approach that I'm not aware of.

Thanks for your help.

Kind regards,
Damian Nowak

More information about the aur-general mailing list