[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Create user during installation

On Thu, Mar 31, 2005 at 10:38:42PM +0200, Tilman Koschnick wrote:
> grep for 'adduser' in /var/lib/dpkg/info/*postinst to see some examples.
> You can use getent(1) to check for the existence of a user.
> Here is what I do (package gpsd):
> postrm:
> | if [ "x$1" = "xpurge" ] ; then
> |         getent passwd gpsd > /dev/null && deluser gpsd
> | fi

Ugh, no. Do *not* remove users on purge, it's reason for all kinds of
problems, amongst others that you can never assure all files owned by
that user are removed, and therefore leaving userless files on the
system. You can't even do a global find, because some partitions can
happen to not be mounted, or others are in fact very slow tape robots.

Leave the deletion of obsolete users up to the system administrator, do
not do so on purge.


Jeroen van Wolffelaar
Jeroen@wolffelaar.nl (also for Jabber & MSN; ICQ: 33944357)

Reply to: