From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on finch.gentoo.org X-Spam-Level: * X-Spam-Status: No, score=1.2 required=5.0 tests=DMARC_NONE,MAILING_LIST_MULTI, RDNS_NONE autolearn=no autolearn_force=no version=4.0.0 Received: from bigglesworth.mail.be.easynet.net (unknown [212.100.160.67]) by chiba.3jane.net (Postfix) with ESMTP id C1E2B2004E13 for ; Wed, 30 Jan 2002 03:24:25 -0600 (CST) Received: from 213-193-176-205.adsl.easynet.be ([213.193.176.205]) by bigglesworth.mail.be.easynet.net with esmtp (Exim 3.16 #1) id 16Vqy1-0003DK-00 for gentoo-dev@gentoo.org; Wed, 30 Jan 2002 10:23:45 +0100 Subject: RE: [gentoo-dev] What is insopts? From: Geert Bevin To: gentoo-dev@gentoo.org In-Reply-To: <1012340650.18868.6.camel@nosferatu.lan> References: <23DFAA462CC6A64487613B0E242D9FF706EB4F@mercury.phoenix-interactive.com> <1012340650.18868.6.camel@nosferatu.lan> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Evolution/1.0.1 Date: 30 Jan 2002 10:23:32 +0100 Message-Id: <1012382612.778.9.camel@inspiron.theleaf.office> Mime-Version: 1.0 Sender: gentoo-dev-admin@gentoo.org Errors-To: gentoo-dev-admin@gentoo.org X-BeenThere: gentoo-dev@gentoo.org X-Mailman-Version: 2.0.6 Precedence: bulk Reply-To: gentoo-dev@gentoo.org List-Help: List-Post: List-Subscribe: , List-Id: Gentoo Linux developer list List-Unsubscribe: , List-Archive: X-Archives-Salt: e1dc20f5-fa60-4f93-b73f-1c029de2d057 X-Archives-Hash: 540879fb56d5aecc0306b3ad42b21d35 Maybe adding a user creation funcitonality to pkg_config and pkg_postrm is a good solution. It isn't executed automatically and it removes the burned from the user to execute the exact commands, since some packages need to even do more things afterwards, like changing permissions and ownership, or even create multiple users. example from a private package: INSTALLDIR="/opt/${PN} MYGRP="mygrp" MYUSR="myusr" pkg_config() { einfo "Creating ${MYGRP} group if needed <==" if [ ! `grep -x "^${MYGRP}:.*" /etc/group` ] ; then groupadd ${MYGRP}; fi einfo "Creating ${MYUSR} user by deleting a previous existing entry if needed <==" if [ `grep -x "^${MYUSR}:.*" /etc/passwd` ] ; then if [ -d ${INSTALLDIR} ] ; then userdel -r ${MYUSR}; else userdel ${MYUSR}; fi fi useradd -m -d ${INSTALLDIR} -g ${MYGRP} ${MYUSR} echo "==> Updating permissions and ownerships <==" chgrp root `dirname ${INSTALLDIR}` chmod 755 `dirname ${INSTALLDIR}` chown -Rf ${MYUSR}.${MYGRP} ${D}${INSTALLDIR} chmod -Rf 775 ${D}${INSTALLDIR} } pkg_postrm() { einfo "Removing ${MYUSR} user if needed <==" if [ `grep -x "^${MYUSR}:.*" /etc/passwd` ] ; then if [ -d ${INSTALLDIR} ] ; then userdel -r ${MYUSR}; else userdel ${MYUSR}; fi fi } On Tue, 2002-01-29 at 22:43, Martin Schlemmer wrote: > On Tue, 2002-01-29 at 23:32, Sean Mitchell wrote: > > Ah! > > > > Okay... is this because there's no sanctioned way to do it from an ebuild? > > Seems to me that /etc/passwd could get huge if we did this for any package > > that wants its own userid(s). > > > > I'm thinking that I should just call useradd... anyone have wisdom to the > > contrary to offer? > > > > On a bit of a tangent, I'm wondering if a qmail or maybe a maildir USE > > variable wouldn't be justified as it can have a big impact on other > > packages. Mailmail is going to require some tweaking for sure. > > > > What I would have done, is create a pkg_postinst() like > follow: > > pkg_postinst() { > if [ -z "`grep "mailman" /etc/passwd`" ] ; then > echo > echo "***************************************" > echo "* Please create a user called mailman *" > echo "***************************************" > fi > } > > Or similar. I for one do not want stuff just to mess with > my config files without me knowing. After all, Gentoo tries > to be user friendly without crippeling the user ... and > how much effort is it to creat the user exactly how you like > it ? > > > Greetings, > > -- > > Martin Schlemmer > Gentoo Linux Developer, Desktop Team Developer > Cape Town, South Africa > -- Geert Bevin the Leaf sprl/bvba "Use what you need" Pierre Theunisstraat 1/47 http://www.theleaf.be 1030 Brussels gbevin@theleaf.be Tel & Fax +32 2 241 19 98