Re: adduser
- To: debian-user@lists.debian.org
- Subject: Re: adduser
- From: bob@proulx.com (Bob Proulx)
- Date: Tue, 31 Jul 2007 23:36:41 -0600
- Message-id: <[🔎] 20070801053641.GA30989@dementia.proulx.com>
- Mail-followup-to: debian-user@lists.debian.org
- In-reply-to: <slrnfaihek.anq.for.gmane@flower.upol.cz>
- References: <ccdab7170707251846p32250b8bkab637dc929cc51d6@mail.gmail.com> <op.tv1znblo4oyyg1@localhost.localdomain> <ccdab7170707252245o75da3779oa5c0999ec54cfdce@mail.gmail.com> <ccdab7170707252322r36f97d13h67b4ec9162bc02f6@mail.gmail.com> <slrnfah3lj.anq.for.gmane@flower.upol.cz> <20070726194818.GC12790@dementia.proulx.com> <slrnfai78o.anq.for.gmane@flower.upol.cz> <20070726233646.GA31687@dementia.proulx.com> <slrnfaihek.anq.for.gmane@flower.upol.cz>
Oleg Verych wrote:
> Ids may change and i will end up with /var/spool/exim4 owned by
> different user in case /etc/passwd is new.
I don't think that should be a concern because if the ownership of
/var/spool/exim4 needs to be non-root then it should be set in the
postinst script. That would be true upon the first installation too,
right? Upon a removal, id scramble, installation the postinst script
will set the correct permissions, right?
Example from the postfix postinst script:
mkdir -p $MAILDROP
if ! chown postfix:postdrop $MAILDROP 2>/dev/null; then
addgroup --system postdrop
chown postfix:postdrop $MAILDROP
fi
Example from the bind9 postinst script:
getent group bind >/dev/null 2>&1 || addgroup --system bind
getent passwd bind >/dev/null 2>&1 ||
adduser --system --home /var/cache/bind --no-create-home \
--disabled-password --ingroup bind bind
Example from openssh-server postinst script:
if ! getent passwd sshd >/dev/null; then
adduser --quiet --system --no-create-home --home /var/run/sshd --shell /usr/sbin/nologin sshd
fi
Expert help for questions about Debian packaging is available on
debian-mentors mailing list. It is where I would go for answers to my
packaging questions.
> If i have /etc/passwd set up, i don't want to install adduser. If there
> will be setup option or prompt: "Do you want to add Debian-exim4 (with
> random UID)?" I want to say no. I don't want global ID. I want not
> random one.
Debconf should be available for those types of questions of the user
at installation time. However if the user selects a non-dynamic id I
don't know how the package could know what global one to use other
than to coordinate it. Asking the admin installing the package for an
id seems like a big step backward.
Also, packages shouldn't call adduser if the user already exists.
Bob
Reply to:
- Follow-Ups:
- Re: adduser
- From: Oleg Verych <for.gmane@flower.upol.cz>