I need rabbitmq-server installed on Ubuntu. Rabbitmq-server tries to start itself on install, and on many dpkg and apt-get commands thereafter. (Having it run on install is intentional, according to the instructions.) On this box, rabbitmq server can't start, and it takes about a minute to give up. I don't want to fix that. I want to make it not try to start whenever I run, say

apt-get install something-not-related-to-rabbitmq

When I do that, not only does it take an extraordinarily long time to install the package, but it also exits with 100, even if the package itself installed fine. Here's a snippet of what happens:

$ sudo apt-get install fortune
Reading package lists... Done

-- SNIP --

Unpacking fortunes-min (1:1.99.1-7) ...
Processing triggers for man-db ( ...
Setting up rabbitmq-server (3.6.0-1) ...
 * Starting message broker rabbitmq-server                                                                                                                                                                                                                                       * FAILED - check /var/log/rabbitmq/startup_\{log, _err\}
invoke-rc.d: initscript rabbitmq-server, action "start" failed.
dpkg: error processing package rabbitmq-server (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up librecode0:amd64 (3.6-21) ...
Setting up fortune-mod (1:1.99.1-7) ...
Setting up fortunes-min (1:1.99.1-7) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ echo $?

I'd rather not uninstall it, as I do eventually plan to get around to using it. But frankly, I think it's a little bit nuts that it hijacks my dpkg, and I would appreciate some help killing that little misfeature with fire.


An easy way to fix this is to make the post-installation start a no-op. The rabbitmq-server.postinst is located in /var/lib/dpkg/info, like all the other postinst scripts, and the jessie version contains the lines:

# Automatically added by dh_installinit
if [ -x "/etc/init.d/rabbitmq-server" ]; then
        update-rc.d rabbitmq-server defaults >/dev/null
        invoke-rc.d rabbitmq-server start || exit $?

Just comment out that entire section, and nothing will happen. Or you can try just commenting out invoke-rc.d rabbitmq-server start || exit $.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.