Bug#663503: apt-get --purge remove fails

March 11th, 2012 - 01:50 pm ET by Thomas Goirand | Report spam
Package: rabbitmq-server
Version: 2.6.1-1
Severity: serious

Hi,

I'm sorry that it's the 2nd time today that I have to send a RC bug
against this package... :(

This one is very easy to reproduce. Luckily, it's also very easy to fix!
Why are you even trying to userdel rabbitmq? Just don't do that, it's
really ok (and I believe *better*) to leave the system user when the
package is removed. Anyway, the issue is very simple: you are deleting
the user *before* rabbitmq had enough time to shutdown. That's in fact
one more reason why you should be using start-stop-daemon, in your init.d
script, which will wait nicely until the daemon dies.

Anyway, here's how to reproduce. Install a fresh SID, then do:
apt-get install rabbitmq-server

Then try to remove:
apt-get --purge remove rabbitmq-server

Then here's the error:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
rabbitmq-server*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 1,970 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 22278 files and directories currently installed.)
Removing rabbitmq-server ...
Stopping rabbitmq-server: rabbitmq-server.
Purging configuration files for rabbitmq-server ...
Removing user `rabbitmq' ...
Warning: group `rabbitmq' has no more members.
userdel: user rabbitmq is currently used by process 1771
/usr/sbin/deluser: `/usr/sbin/userdel rabbitmq' returned error code 8. Exiting.
dpkg: error processing rabbitmq-server (--purge):
subprocess installed post-removal script returned error exit status 1
Processing triggers for man-db ...
configured to not write apport reports
Errors were encountered while processing:
rabbitmq-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Of course, if you do that a 2nd time, since the daemon is already stopped,
it will work.

Cheers,

Thomas Goirand (zigo)



To UNSUBSCRIBE, email to debian-bugs-rc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
email Follow the discussionReplies 3 repliesReplies Make a reply

Similar topics

Replies

#1 Simon MacMullen
March 12th, 2012 - 10:00 am ET | Report spam
On 11/03/12 18:40, Thomas Goirand wrote:
This one is very easy to reproduce. Luckily, it's also very easy to fix!
Why are you even trying to userdel rabbitmq? Just don't do that, it's
really ok (and I believe *better*) to leave the system user when the
package is removed. Anyway, the issue is very simple: you are deleting
the user *before* rabbitmq had enough time to shutdown. That's in fact
one more reason why you should be using start-stop-daemon, in your init.d
script, which will wait nicely until the daemon dies.



The version of rabbitmq-server in Debian (2.6.1) is slightly out of date
as it lost its maintainer for a bit. The bug you reference should be
fixed in 2.7.0 / 2.7.1 (deb available from
http://www.rabbitmq.com/install-debian.html) due to the "rabbitmqctl
stop" command not returning until the server is actually stopped.

The next release (2.8.0, imminent, by which time we should have a Debian
Maintainer on the RabbitMQ team to upload it) will switch to using
start-stop-daemon.

Finally, I'll look into not invoking userdel. That sounds plausible. A
quick google points me to Debian bug 621833, which seems to say "do not
remove".

Cheers, Simon

Simon MacMullen
RabbitMQ, VMware



To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
Replies Reply to this message
#2 Thomas Goirand
March 12th, 2012 - 11:10 am ET | Report spam
Hi, and thanks for your quick reply,

On 03/12/2012 10:45 PM, Simon MacMullen wrote:
The version of rabbitmq-server in Debian (2.6.1) is slightly out of date
as it lost its maintainer for a bit. The bug you reference should be
fixed in 2.7.0 / 2.7.1 (deb available from
http://www.rabbitmq.com/install-debian.html) due to the "rabbitmqctl
stop" command not returning until the server is actually stopped.

The next release (2.8.0, imminent, by which time we should have a Debian
Maintainer on the RabbitMQ team to upload it) will switch to using
start-stop-daemon.



If you need somebody to act as upload sponsor, let me know, I can help
(however, I don't want to become a permanent sponsor).

Finally, I'll look into not invoking userdel. That sounds plausible. A
quick google points me to Debian bug 621833, which seems to say "do not
remove".



There's nothing written in the stone of the Debian policy for this, and
in fact, it's quite a controversial topic. One thing is that if you do
call userdel, you have to be extremely careful that absolutely no file
are left on the hard drive with the UID/GID of the user you created. If
you decide to just leave the system user, that's the easy path, and
nobody will be able complain about it (it's a common way to do things,
and it's the way maintainers do in RedHat/Fedora as well I believe).

Cheers,

Thomas



To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
Replies Reply to this message
#3 Simon MacMullen
March 13th, 2012 - 12:10 pm ET | Report spam
On 12/03/12 16:03, Thomas Goirand wrote:
If you need somebody to act as upload sponsor, let me know, I can help
(however, I don't want to become a permanent sponsor).



Thank you. I think we should be good though.

> Finally, I'll look into not invoking userdel. That sounds plausible. A
> quick google points me to Debian bug 621833, which seems to say "do not
> remove".



There's nothing written in the stone of the Debian policy for this, and
in fact, it's quite a controversial topic. One thing is that if you do
call userdel, you have to be extremely careful that absolutely no file
are left on the hard drive with the UID/GID of the user you created. If
you decide to just leave the system user, that's the easy path, and
nobody will be able complain about it (it's a common way to do things,
and it's the way maintainers do in RedHat/Fedora as well I believe).



Thanks. I think not removing it sounds like the simplest thing to do...

Cheers, Simon

Simon MacMullen
RabbitMQ, VMware



To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
email Follow the discussion Replies Reply to this message
Help Create a new topicReplies Make a reply
Search Make your own search