Hi,

Many thanks for your quick answer.

The way that MySQL do it works fine. It's in two step, create the group
then the user.

    # creating mysql group if he isn't already there
    if ! getent group mysql >/dev/null; then
         # Adding system group: mysql.
        addgroup --system mysql >/dev/null
    fi

    # creating mysql user if he isn't already there
    if ! getent passwd mysql >/dev/null; then
        # Adding system user: mysql.
        adduser \
          --system \
              --disabled-login \
          --ingroup mysql \
          --no-create-home \
         --home /nonexistent \
         --gecos "MySQL Server" \
         --shell /bin/false \
          mysql  >/dev/null
    fi

William


On Fri, Aug 22, 2014 at 3:38 AM, Chris Knadle <[email protected]>
wrote:

> On Thursday, August 21, 2014 22:37:13 William MARTIN wrote:
> > Package: mumble-server
> > Version: 1.2.3-349-g315b5f5-2.2+deb7u1
> > Severity: important
> >
> > Dear Maintainer,
> >
> > I am installing mumble on a HA cluster with gluster filesystem.
> > To ensure that all servers have the same id for users and groups on
> shared
> > folders, i create manually all users/groups needed with custom id (i.e.
> > 1000+). Unfortunately, the mumble-server configure script failed if the
> > user is already created. The create user command failed because the user
> is
> > already created, so funny !
> >
> > Issue is in debian rules, file is mumble-server.postinst, on the
> following
> > line :
> >
> >     adduser --system --quiet --home /var/lib/mumble-server --group
> > mumble-server
> >
> > Best regards,
> > William MARTIN
>
> I had a look through other packages to see how other maintainers have
> handled
> this; most packages do exactly the same thing that the
> mumble-server.postinst
> does and simply call 'adduser' and would have the same error.  However
> there
> were a couple of notable exceptions that I think would handle this case:
>
> dnsmasq-base.postinst:
>   if [ "$1" = "configure" ]; then
>      if [ -z "`id -u dnsmasq 2> /dev/null`" ]; then
>         adduser --system  --home /var/lib/misc --gecos "dnsmasq" \
>           --no-create-home --disabled-password \
>           --quiet dnsmasq || true
>      fi
>
> exim4-base.postinst:
>   case "$1" in
>     configure)
>
>       if ! getent passwd Debian-exim > /dev/null ; then
>         echo 'Adding system-user for exim (v4)' 1>&2
>         adduser --system --group --quiet --home /var/spool/exim4 \
>           --no-create-home --disabled-login --force-badname Debian-exim
>       fi
>
> wicd-daemon.postinst:
>   case "$1" in
>     configure)
>         if [ ! $(getent group netdev) ]; then
>                 addgroup --quiet --system netdev
>         fi
>
>
> Out of curiosity let me know which of the three examples above you like
> most.
>
> Whether I can get the fix into the -349 package in Wheezy in a point
> release
> is something I'll need to discuss with the Release Team.
>
>   -- Chris
>
> --
>
> Chris Knadle
> [email protected]
>



-- 
William MARTIN
<http://www.power-lan.com/>
15 rue de la Noé des Yonnières
44850 Saint-Mars-du-Désert

Email : [email protected]
Tel : 02 85 52 12 74 - 06 49 23 59 68
Fax : 02 85 52 13 72

Reply via email to