Bug#758833: mumble-server: Installation failed if the user mumble-server is already created

2014-09-13 Thread Chris Knadle
On Friday, August 22, 2014 09:46:02 William Martin wrote:
 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

First: if a mumble-server user+group are pre-allocated in the = 999 UID/GID 
range, the package in Debian as it is now installs fine; this bug happened 
because the UID/GID range that had been added was in the normal user range 
of  1000 and the postinst script requests adding a system mumble-server 
user+group -- so the fact that the adduser command fails when trying to add a 
user/group of a different type when it already exists is technically correct 
behavior.



Second: I tested the simultaneous user+group creation after checking that 
the group doesn't exist:

   # add user + group together
   if [ $(getent group mumble-server) ]; then
adduser --system --quiet --home /var/lib/mumble-server \
  --group mumble-server
   fi


If the mumble-server user+group that are added are in the 'system' range of
= 999 for the UID+GID then they're removed when the package is purged; if 
they're in the = 1000 normal user UID+GID range then both the group and 
user are preserved when the package is purged.  That seems reasonable.

   # testing both user + group added:
   addgroup --gid 1005 mumble-server
   adduser --disabled-password --uid 1005 --ingroup mumble-server \
 -- home /var/lib/mumble-server --shell /bin/false mumble-server

   dpkg -i mumble-server_1.2.8-1+0cduA+wheezy_amd64.deb
   dpkg -P mumble-server
   getent group mumble-server
 mumble-server:x:1005:
   getent passwd mumble-server
 mumble-server:x:1005:1005:,,,:/var/lib/mumble-server:/bin/false



Finally: I've tested this separate creation of group then user method and I 
don't like the behavior of it as much as the joint user+group creation.  The 
specific change to the postinst script I tried was this:

   # add group separately
   if [ ! $(gentent group mumble-server) ]; then
addgroup --system --quiet mumble-server
   fi
   # add user separately
   if [ !(getent passwd mumble-server) ]; then
adduser --system --quiet --home /var/lib/mumble-server \
  --ingroup mumble-server mumble-server
   fi


   # testing adding only the group
   addgroup --gid 1005 mumble-server
   dpkg -i mumble-server_1.2.8-1+0cduB+wheezy_amd64.deb
   getent group mumble-server
 mumble-server:x:1005:
   getent passwd mumble-server
 mumble-server:x:102:1005::/var/lib/mumble-server:/bin/false
   dpkg -P mumble-server
   getent group mumble-server
 no entry

What I don't like about the separate group then user creation is that this 
allows for a GID in the = 1000 range yet a UID in the = 999 range, then 
because the UID is in the = 999 range both are removed upon the package being 
purged.  I don't know what sense it makes to allow this and it's not the 
behavior I would like to see.

So unless there's a strong objection with reasoning, I want to implement the 
simultaneous user+group creation after checking for the existence of the 
group.

  -- Chris

--

Chris Knadle
chris.kna...@coredump.us


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#758833: mumble-server: Installation failed if the user mumble-server is already created

2014-08-22 Thread William Martin
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 chris.kna...@coredump.us
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)' 12
 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
 chris.kna...@coredump.us




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

Email : william.mar...@power-lan.com
Tel : 02 85 52 12 74 - 06 49 23 59 68
Fax : 02 85 52 13 72


Bug#758833: mumble-server: Installation failed if the user mumble-server is already created

2014-08-21 Thread William MARTIN
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

-- System Information:
Debian Release: 7.6
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages mumble-server depends on:
ii  adduser3.113+nmu3
ii  dbus   1.6.8-1+deb7u3
ii  debconf [debconf-2.0]  1.5.49
ii  libavahi-client3   0.6.31-2
ii  libavahi-common3   0.6.31-2
ii  libavahi-compat-libdnssd1  0.6.31-2
ii  libc6  2.13-38+deb7u3
ii  libcap21:2.22-1.2
ii  libgcc11:4.7.2-5
ii  libiceutil34   3.4.2-8.2
ii  libprotobuf7   2.4.1-3
ii  libqt4-dbus4:4.8.2+dfsg-11
ii  libqt4-network 4:4.8.2+dfsg-11
ii  libqt4-sql 4:4.8.2+dfsg-11
ii  libqt4-sql-sqlite  4:4.8.2+dfsg-11
ii  libqt4-xml 4:4.8.2+dfsg-11
ii  libqtcore4 4:4.8.2+dfsg-11
ii  libssl1.0.01.0.1e-2+deb7u12
ii  libstdc++6 4.7.2-5
ii  libzeroc-ice34 3.4.2-8.2

mumble-server recommends no packages.

Versions of packages mumble-server suggests:
pn  mumble-django  none
pn  mumble-server-web  none

-- Configuration Files:
/etc/default/mumble-server [Errno 2] No such file or directory: 
u'/etc/default/mumble-server'
/etc/mumble-server.ini [Errno 2] No such file or directory: 
u'/etc/mumble-server.ini'
== Notes : Both files are links on my system, it's not related to my issue

-- debconf information:
  mumble-server/use_capabilities: false
  mumble-server/start_daemon: true


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#758833: mumble-server: Installation failed if the user mumble-server is already created

2014-08-21 Thread Chris Knadle
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)' 12
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
chris.kna...@coredump.us


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org