service start rabbitmq-server' does not fully detach from parent

Bug #878600 reported by Scott Moser
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
rabbitmq-server (Debian)
Fix Released
Unknown
rabbitmq-server (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

$ ssh SOMEHOST "sh -c '{ sudo apt-get install -y rabbitmq-server; echo FINISHED; } | tee my.log'"
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  rabbitmq-server
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin:
0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
Need to get 0 B/1,036 kB of archives.
After this operation, 1,790 kB of additional disk space will be used.
Selecting previously deselected package rabbitmq-server.
(Reading database ... 28934 files and directories currently installed.)
Unpacking rabbitmq-server (from .../rabbitmq-server_2.5.0-1ubuntu2_all.deb) ...
Processing triggers for man-db ...
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
Processing triggers for ureadahead ...
Setting up rabbitmq-server (2.5.0-1ubuntu2) ...
Starting rabbitmq-server: SUCCESS
rabbitmq-server.
FINISHED

After 'FINISHED' is written (indicating that obviously the apt-get finished) the ssh connection and 'tee' stay around.

you can then 'apt-get --purge remove rabbitmq-server' and see bug 878597 and then reproduce it.

While the connection and tee are hung, you can then run the following to stop the server, which will result in the ssh command finishing.

$ sudo service rabbitmq-server stop
Stopping rabbitmq-server: rabbitmq-server.

This was found when launching devstack (devstack.org) from an ssh connection.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: rabbitmq-server 2.5.0-1ubuntu2
ProcVersionSignature: User Name 3.0.0-12.20-virtual 3.0.4
Uname: Linux 3.0.0-12-virtual x86_64
ApportVersion: 1.23-0ubuntu3
Architecture: amd64
Date: Thu Oct 20 00:45:58 2011
Ec2AMI: ami-87bb74ee
Ec2AMIManifest: ubuntu-images-testing-us/ubuntu-oneiric-daily-amd64-server-20111019.manifest.xml
Ec2AvailabilityZone: us-east-1c
Ec2InstanceType: m1.large
Ec2Kernel: aki-825ea7eb
Ec2Ramdisk: unavailable
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: rabbitmq-server
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Scott Moser (smoser) wrote :
Scott Moser (smoser)
summary: - 'apt-get install rabbitmq | tee' from an ssh connection hangs
+ 'service start rabbitmq-server' does not fully detach from parent
Revision history for this message
Scott Moser (smoser) wrote : Re: 'service start rabbitmq-server' does not fully detach from parent

Once rabbitmq-server had been installed, I can reproduce this with:
$ ssh $host "sudo service rabbitmq-server start"

Ie, no 'tee' is necessary.

This, however, does not exhibit the hang:
$ sudo service rabbitmq-server start >out 2>&1"

This patch seems to fix it for me:
--- /etc/init.d/rabbitmq-server.dist 2011-10-20 01:01:07.852757569 +0000
+++ /etc/init.d/rabbitmq-server 2011-10-20 01:02:32.204758210 +0000
@@ -40,8 +40,8 @@
     else
         RETVAL=0
         set +e
- setsid sh -c "$DAEMON > ${INIT_LOG_DIR}/startup_log \
- 2> ${INIT_LOG_DIR}/startup_err" &
+ setsid sh -c "exec $DAEMON" > "${INIT_LOG_DIR}/startup_log" \
+ 2> "${INIT_LOG_DIR}/startup_err" &
         $CONTROL wait >/dev/null 2>&1
         RETVAL=$?
         set -e

Changed in rabbitmq-server (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Scott Moser (smoser)
summary: - 'service start rabbitmq-server' does not fully detach from parent
+ service start rabbitmq-server' does not fully detach from parent
Changed in rabbitmq-server (Debian):
status: Unknown → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rabbitmq-server - 2.6.1-1ubuntu2

---------------
rabbitmq-server (2.6.1-1ubuntu2) precise; urgency=low

  * close file handles of rabbitmq-server daemon in init script (LP: #878600)
  * fix dpkg failure on purge (LP: #878597)
 -- Scott Moser <email address hidden> Tue, 25 Oct 2011 12:51:20 -0400

Changed in rabbitmq-server (Ubuntu):
status: Triaged → Fix Released
Changed in rabbitmq-server (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.