From owner-freebsd-ports Fri Oct 19 0: 6: 1 2001 Delivered-To: freebsd-ports@freebsd.org Received: from net2.dinoex.sub.org (net2.dinoex.de [212.184.201.182]) by hub.freebsd.org (Postfix) with ESMTP id 54C3137B403 for ; Fri, 19 Oct 2001 00:05:56 -0700 (PDT) Received: from gate.dinoex.sub.org (dinoex@localhost) by net2.dinoex.sub.org (8.11.6/8.11.6) with BSMTP id f9J75Ff20096; Fri, 19 Oct 2001 09:05:15 +0200 (CEST) (envelope-from dirk.meyer@dinoex.sub.org) To: freebsd-ports@FreeBSD.ORG, ache@nagual.pp.ru Message-ID: <4QAWHA6EXO@dmeyer.dinoex.sub.org> From: dirk.meyer@dinoex.sub.org (Dirk Meyer) Organization: privat Subject: Re: HEADS UP: Apache port change from nobody:nogroup to www:www planned Date: Fri, 19 Oct 2001 09:01:39 +0200 X-Mailer: Dinoex 1.77 References: <20011017155854.A43168@nagual.pp.ru> X-Gateway: ZCONNECT gate.dinoex.sub.org [UNIX/Connect 0.93] X-Accept-Language: de,en X-PGP-Fingerprint: 44 16 EC 0A D3 3A 4F 28 8A 8A 47 93 F1 CF 2F 12 X-Noad: Please don't send me ad's by mail. I'm bored by this type of mail. X-Copyright: (C) Copyright 2001 by Dirk Meyer -- All rights reserved. X-Note: sending SPAM is a violation of both german and US law and will at least trigger a complaint at your provider's postmaster. X-PGP-Key-Avail: mailto:pgp-public-keys@keys.de.pgp.net Subject:GET 0x331CDA5D X-No-Archive: yes X-ZC-VIA: 20011019000000S+2@dinoex.sub.org Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Andrey A. Chernov wrote:, > What is the best way to _automatically_ add www:www to > /etc/{passwd,group}? I think about 'pw' command, but it will be nice if > somebody already have working example. I would suggest: in Makefile: pre-install: if ! pw groupshow www; then pw groupadd www -g 80; fi if ! pw usershow www; then pw useradd www -g www -u 80 \ -h - -d /nonexistent -s /nonexistent -c "Webserver Daemon"; fi in pkg-plist: @exec if ! pw groupshow www 2>/dev/null; then pw groupadd www -g 80; fi @exec if ! pw usershow www 2>/dev/null; then pw useradd www -g www -u 80 -h - -d /nonexistent -s /nonexistent -c "Webserver Daemon"; fi @unexec if pw usershow www | grep -q 80:80; then pw userdel www; fi @comment (removed by userdel) pw groupdel www Features: + No extra scripts. + this will preserve existing UID/GID Drawbacks: - Must be done and tested in two locations Suggestions of cause welcome. kind regards Dirk - Dirk Meyer, Im Grund 4, 34317 Habichtswald, Germany To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message