Subject: Re: pkg/17049: pkg system modifies password database on its own
To: NetBSD Packages Technical Discussion List <tech-pkg@NetBSD.ORG>
From: Jim Bernard <jbernard@mines.edu>
List: tech-pkg
Date: 05/27/2002 16:26:46
On Sun, May 26, 2002 at 09:59:33PM -0400, Greg A. Woods wrote:
> 
> So, what should we do?  I would argue, once again, that pkgsrc should
> make use of REQUIRE scripts to test the target system for the presence
> of necessary prequisites that fall outside the basic feature tests
> provided for in pkg_add itself (i.e. dependency checking, etc.).  Such
> scripts could then issue a message recommending a given set of commands
> to be run to correct the system state such that it will suffice for
> installation to continue (eg. "useradd" commands to add users, etc.).
> 
> Anyway time to go watch Detective Frost.....  Let me know what you think
> so far!  :-)
> 
> 
> (*) Regarding REQUIRE scripts, paraphrased from the FreeBSD docs:
> 
>    If your package needs to determine if it should install or not, you
>    should write a REQ[UIRE] ``requirements'' script.  It will be invoked
>    automatically at installation/deinstallation time by "pkg_add" to
>    determine whether or not installation/deinstallation should proceed.
>                                                                                 
>    The script will be run at installation time by "pkg_add" as follows:
> 
> 	REQ[UIRE] ${PKGNAME} INSTALL
> 
>    At deinstallation time it will be run by "pkg_delete" as follows:
> 
> 	REQ[UIRE] ${PKGNAME} DEINSTALL.
> 
>    The REQUIRE script should not change anything on the system.  It
>    should simply gather the information it needs and then make its
>    decision based on what it sees.

  Well, it seems like the REQUIRE scripts could indeed be useful in
many cases, but they wouldn't be quite right as a tool for making sure
the user database is properly set up.  The reason is that installation
may not necessitate the existence of the new userid (in the case of
qpopper, for example, there's no reason the installation couldn't have
proceeded without it---qpopauth wants to be suid pop, but that's only
needed if you actually decide to use it).  I would prefer to see the
installation proceed as requested, and to receive notification that
certain actions need to be taken in order to actually use the software.
Or an activation/initialization script could be provided but not run by
default at installation time.