Users needed or not by ports

Jeremy Chadwick freebsd at
Mon Oct 11 16:23:13 UTC 2010

On Mon, Oct 11, 2010 at 06:01:46PM +0200, David DEMELIER wrote:
> Before writing a patch for the ports framework, I just want to be sure
> that FreeBSD ports shouldn't use a same user added by ports. For
> example pulseaudio adds some users to the system (pulse,
> pulse-whatever) and should these users be needed from others ports ?

I think this is exactly what ports/UIDs and ports/GIDs is for?  These
are usable via the USERS and GROUPS directives in the port Makefile.

> My plan is :
> 1. Register users added and needed by ports in files like +USERS +GROUPS,
> 2. When make deinstall or pkg_delete port_name check if the user is
> still needed by other port (if this is possible)

Step #2 is probably where most of the work will need to be done, since
now the dependency checks will have to involve checking usernames and

I imagine this is why you plan on creating +USERS and +GROUPS files in
/var/db/pkg/<name>, since at present this information isn't tracked

Be aware that you might get some pushback regarding this method of
implementation, due to the increased inode usage on systems which have
lots of packages/ports installed.  This might sound like a silly
argument, but on embedded systems it's a serious concern.

An alternative/workaround might be to stick the information (user and
group names) into +CONTENTS instead.

> 3. Print a message like "The following users and group are not needed
> anymore by the system : xxx yyy"

Some ports already echo this -- you'll need to figure out which ones do
and make sure the respective maintainers update their ports to utilise
the new framework.

| Jeremy Chadwick                                   jdc at |
| Parodius Networking              |
| UNIX Systems Administrator                  Mountain View, CA, USA |
| Making life hard for others since 1977.              PGP: 4BD6C0CB |

More information about the freebsd-ports mailing list