From owner-freebsd-ports@FreeBSD.ORG Mon Oct 11 16:23:13 2010 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 915A1106566B for ; Mon, 11 Oct 2010 16:23:13 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta06.westchester.pa.mail.comcast.net (qmta06.westchester.pa.mail.comcast.net [76.96.62.56]) by mx1.freebsd.org (Postfix) with ESMTP id 3EAC28FC23 for ; Mon, 11 Oct 2010 16:23:12 +0000 (UTC) Received: from omta18.westchester.pa.mail.comcast.net ([76.96.62.90]) by qmta06.westchester.pa.mail.comcast.net with comcast id HQ3f1f0031wpRvQ56UPDvf; Mon, 11 Oct 2010 16:23:13 +0000 Received: from koitsu.dyndns.org ([98.248.41.155]) by omta18.westchester.pa.mail.comcast.net with comcast id HUPC1f0023LrwQ23eUPC0F; Mon, 11 Oct 2010 16:23:13 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id DA43E9B418; Mon, 11 Oct 2010 09:23:10 -0700 (PDT) Date: Mon, 11 Oct 2010 09:23:10 -0700 From: Jeremy Chadwick To: David DEMELIER Message-ID: <20101011162310.GA12022@icarus.home.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-ports Subject: Re: Users needed or not by ports X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 16:23:13 -0000 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 groups. I imagine this is why you plan on creating +USERS and +GROUPS files in /var/db/pkg/, since at present this information isn't tracked there. 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@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |