** Description changed:

  [ Impact ]
  
  When installing rabbitmq-server after another package that uses port
  5672, such as garagemq, the installation will fail with:
  
  Job for rabbitmq-server.service failed because the control process exited 
with error code.
  See "systemctl status rabbitmq-server.service" and "journalctl -xeu 
rabbitmq-server.service" for details.
  
  This is due to a combination of the systemd service failing to start
  when it tries to take the port, and the use of dh_installinit instead of
  dh_systemd_start, which provides a code block that exits with an error
  on service failure.
  
  This bug is fixed by swapping to dh_systemd_start, which allows the
  install to continue on service failure, and by notifying the user that
  the service will fail by checking to see if the port is taken by another
  package.
  
  [ Test Plan ]
  
  To test, install garagemq followed by rabbitmq-server. Before this fix,
  this would cause the rabbitmq-server to fail. After, the install should
  instead display the following message and succeed:
  
  WARNING: port 5672 is already in use by another application.
  RabbitMQ server will not be started automatically.
  
  Also, installing rabbitmq-server first should also be tested to show
  that the above message does not show up. Same with a rabbitmq-server
  upgrade.
  
  [ Where problems could occur ]
  
  Problems would most likely occur here due to differences in behavior
- between systemd's dh processes vs dh_installinit's.
+ between dh_systemd_start vs dh_installinit.
+ 
+ Here are the automatically added sections before and after the update:
+ 
+ questing:
+ 
+ before:
+ 
+ preinst:
+ # Automatically added by dh_installinit/13.24.2ubuntu1
+ if [ "$1" = "install" ] && [ -n "$2" ] && [ -e "/etc/init.d/rabbitmq-server" 
] ; then
+       chmod +x "/etc/init.d/rabbitmq-server" >/dev/null || true
+ fi
+ # End automatically added section
+ 
+ postinst:
+ # Automatically added by dh_installinit/13.24.2ubuntu1
+ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = 
"abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
+       if [ -z "$DPKG_ROOT" ] && [ -x "/etc/init.d/rabbitmq-server" ]; then
+               update-rc.d rabbitmq-server defaults >/dev/null
+               if [ -n "$2" ]; then
+                       _dh_action=restart
+               else
+                       _dh_action=start
+               fi
+               invoke-rc.d rabbitmq-server $_dh_action || exit 1
+       fi
+ fi
+ # End automatically added section
+ 
+ prerm:
+ # Automatically added by dh_installinit/13.24.2ubuntu1
+ if [ -z "$DPKG_ROOT" ] && [ "$1" = remove ] && [ -x 
"/etc/init.d/rabbitmq-server" ] ; then
+       invoke-rc.d rabbitmq-server stop || exit 1
+ fi
+ # End automatically added section
+ 
+ postrm:
+ # Automatically added by dh_installinit/13.24.2ubuntu1
+ if [ "$1" = "remove" ] && [ -x "/etc/init.d/rabbitmq-server" ] ; then
+       chmod -x "/etc/init.d/rabbitmq-server" >/dev/null || true
+ fi
+ if [ -z "$DPKG_ROOT" ] && [ "$1" = "purge" ] ; then
+       update-rc.d rabbitmq-server remove >/dev/null
+ fi
+ # End automatically added section
+ 
+ 
+ after:
+ 
+ preinst:
+ none
+ 
+ postinst:
+ # Automatically added by dh_systemd_start/13.24.2ubuntu1
+ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = 
"abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
+       if [ -d /run/systemd/system ]; then
+               systemctl --system daemon-reload >/dev/null || true
+               if [ -n "$2" ]; then
+                       _dh_action=restart
+               else
+                       _dh_action=start
+               fi
+               deb-systemd-invoke $_dh_action 'rabbitmq-server.service' 
>/dev/null || true
+       fi
+ fi
+ # End automatically added section
+ 
+ prerm:
+ # Automatically added by dh_systemd_start/13.24.2ubuntu1
+ if [ -z "$DPKG_ROOT" ] && [ "$1" = remove ] && [ -d /run/systemd/system ] ; 
then
+       deb-systemd-invoke stop 'rabbitmq-server.service' >/dev/null || true
+ fi
+ # End automatically added section
+ 
+ postrm:
+ # Automatically added by dh_systemd_start/13.24.2ubuntu1
+ if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
+       systemctl --system daemon-reload >/dev/null || true
+ fi
+ # End automatically added section
+ 
+ 
+ noble:
+ 
+ before:
+ 
+ preinst:
+ # Automatically added by dh_installinit/13.14.1ubuntu5
+ if [ "$1" = "install" ] && [ -n "$2" ] && [ -e "/etc/init.d/rabbitmq-server" 
] ; then
+       chmod +x "/etc/init.d/rabbitmq-server" >/dev/null || true
+ fi
+ # End automatically added section
+ 
+ postinst:
+ # Automatically added by dh_installinit/13.14.1ubuntu5
+ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = 
"abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
+       if [ -z "${DPKG_ROOT:-}" ] && [ -x "/etc/init.d/rabbitmq-server" ]; then
+               update-rc.d rabbitmq-server defaults >/dev/null
+               if [ -n "$2" ]; then
+                       _dh_action=restart
+               else
+                       _dh_action=start
+               fi
+               invoke-rc.d rabbitmq-server $_dh_action || exit 1
+       fi
+ fi
+ # End automatically added section
+ 
+ prerm:
+ # Automatically added by dh_installinit/13.14.1ubuntu5
+ if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -x 
"/etc/init.d/rabbitmq-server" ] ; then
+       invoke-rc.d rabbitmq-server stop || exit 1
+ fi
+ # End automatically added section
+ 
+ postrm:
+ # Automatically added by dh_installinit/13.14.1ubuntu5
+ if [ "$1" = "remove" ] && [ -x "/etc/init.d/rabbitmq-server" ] ; then
+       chmod -x "/etc/init.d/rabbitmq-server" >/dev/null || true
+ fi
+ if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = "purge" ] ; then
+       update-rc.d rabbitmq-server remove >/dev/null
+ fi
+ # End automatically added section
+ 
+ 
+ after:
+ 
+ preinst:
+ none
+ 
+ postinst:
+ # Automatically added by dh_systemd_start/13.14.1ubuntu5
+ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = 
"abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
+       if [ -d /run/systemd/system ]; then
+               systemctl --system daemon-reload >/dev/null || true
+               if [ -n "$2" ]; then
+                       _dh_action=restart
+               else
+                       _dh_action=start
+               fi
+               deb-systemd-invoke $_dh_action 'rabbitmq-server.service' 
>/dev/null || true
+       fi
+ fi
+ # End automatically added section
+ 
+ prerm:
+ # Automatically added by dh_systemd_start/13.14.1ubuntu5
+ if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -d /run/systemd/system ] 
; then
+       deb-systemd-invoke stop 'rabbitmq-server.service' >/dev/null || true
+ fi
+ # End automatically added section
+ 
+ postrm:
+ # Automatically added by dh_systemd_start/13.14.1ubuntu5
+ if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
+       systemctl --system daemon-reload >/dev/null || true
+ fi
+ # End automatically added section
+ 
+ 
+ jammy:
+ 
+ before:
+ 
+ postinst:
+ # Automatically added by dh_installinit/13.6ubuntu1
+ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = 
"abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
+       if [ -z "${DPKG_ROOT:-}" ] && [ -x "/etc/init.d/rabbitmq-server" ]; then
+               update-rc.d rabbitmq-server defaults >/dev/null
+               if [ -n "$2" ]; then
+                       _dh_action=restart
+               else
+                       _dh_action=start
+               fi
+               invoke-rc.d rabbitmq-server $_dh_action || exit 1
+       fi
+ fi
+ # End automatically added section
+ 
+ prerm:
+ # Automatically added by dh_installinit/13.6ubuntu1
+ if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -x 
"/etc/init.d/rabbitmq-server" ] ; then
+       invoke-rc.d rabbitmq-server stop || exit 1
+ fi
+ # End automatically added section
+ 
+ postrm:
+ # Automatically added by dh_installinit/13.6ubuntu1
+ if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = "purge" ] ; then
+       update-rc.d rabbitmq-server remove >/dev/null
+ fi
+ # End automatically added section
+ 
+ 
+ after:
+ 
+ postinst:
+ # Automatically added by dh_systemd_start/13.6ubuntu1
+ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = 
"abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
+       if [ -d /run/systemd/system ]; then
+               systemctl --system daemon-reload >/dev/null || true
+               if [ -n "$2" ]; then
+                       _dh_action=restart
+               else
+                       _dh_action=start
+               fi
+               deb-systemd-invoke $_dh_action 'rabbitmq-server.service' 
>/dev/null || true
+       fi
+ fi
+ # End automatically added section
+ 
+ prerm:
+ # Automatically added by dh_systemd_start/13.6ubuntu1
+ if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -d /run/systemd/system ] 
; then
+       deb-systemd-invoke stop 'rabbitmq-server.service' >/dev/null || true
+ fi
+ # End automatically added section
+ 
+ postrm:
+ # Automatically added by dh_systemd_start/13.6ubuntu1
+ if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
+       systemctl --system daemon-reload >/dev/null || true
+ fi
+ # End automatically added section
  
  [ Other Info ]
  
  The reason dh_installinit fails is due to its generated start code
  being:
  
  invoke-rc.d rabbitmq-server $_dh_action || exit 1
  
  while dh_systemd_start's start code is
  
  deb-systemd-invoke $_dh_action 'rabbitmq-server.service' >/dev/null ||
  true
  
  [ Original Description ]
  
  E: rabbitmq-server: »installiertes post-installation-Skript des Paketes
  rabbitmq-server«-Unterprozess gab den Fehlerwert 1 zurück
  
  ProblemType: Package
  DistroRelease: Ubuntu 24.04
  Package: rabbitmq-server 3.12.1-1ubuntu1.2
  ProcVersionSignature: Ubuntu 6.14.0-34.34~24.04.1-generic 6.14.11
  Uname: Linux 6.14.0-34-generic x86_64
  NonfreeKernelModules: nvidia_modeset nvidia
  ApportVersion: 2.28.1-0ubuntu3.8
  Architecture: amd64
  CasperMD5CheckResult: pass
  Date: Sat Nov 1 13:10:14 2025
  ErrorMessage: »installiertes post-installation-Skript des Paketes 
rabbitmq-server«-Unterprozess gab den Fehlerwert 1 zurück
  InstallationDate: Installed on 2025-10-31 (1 days ago)
  InstallationMedia: Ubuntu 24.04.2 LTS "Noble Numbat" - Release amd64 
(20250215)
  PackageArchitecture: all
  Python3Details: /usr/bin/python3.12, Python 3.12.3, python3-minimal, 
3.12.3-0ubuntu2
  PythonDetails: N/A
  RelatedPackageVersions:
-  dpkg 1.22.6ubuntu6.5
-  apt 2.7.14build2
+  dpkg 1.22.6ubuntu6.5
+  apt 2.7.14build2
  SourcePackage: rabbitmq-server
  Title: package rabbitmq-server 3.12.1-1ubuntu1.2 failed to install/upgrade: 
»installiertes post-installation-Skript des Paketes 
rabbitmq-server«-Unterprozess gab den Fehlerwert 1 zurück
  UpgradeStatus: No upgrade log present (probably fresh install)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2130487

Title:
  rabbitmq-server install fails when another package is using port 5672

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/rabbitmq-server/+bug/2130487/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to