Commit Graph

301 Commits

Author SHA1 Message Date
Gerhard Lazu 1cebe511b7 Merge remote-tracking branch 'origin/stable' 2017-08-21 17:34:40 +01:00
Daniil Fedotov 5edcecc937 Move verify_steps function into upgrade-helpers
No point in having 2 scripts

Signed-off-by: Gerhard Lazu <gerhard@rabbitmq.com>
2017-08-21 17:28:41 +01:00
Daniil Fedotov febd7c37d7 Extract common 3.6 & 3.7 upgrade-to-helpers
Signed-off-by: Gerhard Lazu <gerhard@rabbitmq.com>
2017-08-21 17:22:33 +01:00
Daniil Fedotov 01d9aeb9a6 Make upgrade verification errors more descriptive for 3.6
Signed-off-by: Gerhard Lazu <gerhard@rabbitmq.com>
2017-08-21 16:51:45 +01:00
Gerhard Lazu b5a09c4df0 Merge pull request #40 from rabbitmq/rabbitmq-server-release-32
Fixes for SELinux support
2017-08-17 15:11:23 +02:00
Luke Bakken 402aab2857
Error message change from review. 2017-08-17 06:05:28 -07:00
Luke Bakken c8b6b74a9c
Fixes for SELinux support
Use /sbin/runuser to execute script as the `rabbitmq` user as this command
does not cause issues with SELinux. See #32 for details.
2017-08-16 20:13:30 -07:00
Michael Klishin 00469eba2f
Merge branch 'stable' 2017-08-16 19:01:01 +03:00
Michael Klishin b2c830a76d Commit package change logs 2017-08-16 13:25:30 +01:00
Michael Klishin 16bedf2021
Merge branch 'stable' 2017-08-11 02:25:09 +03:00
Michael Klishin 268e907b0b Merge pull request #38 from rabbitmq/rabbitmq-server-1324
Configure shortcuts to run as admin.
2017-08-10 20:26:02 +03:00
Jean-Sébastien Pédron 773133d8f3
Merge branch 'stable' 2017-08-10 15:59:00 +02:00
Jean-Sébastien Pédron 182f773c92
debian/control: Revert the use of ${misc:Depends}
This reverts part of commit 851561953a.

We need to hard-code the dependency on init-system-helpers to support
Ubuntu 14.04.

(cherry picked from commit 12d2edad42)
2017-08-10 15:58:22 +02:00
Jean-Sébastien Pédron 12d2edad42
debian/control: Revert the use of ${misc:Depends}
This reverts part of commit 851561953a.

We need to hard-code the dependency on init-system-helpers to support
Ubuntu 14.04.
2017-08-10 15:57:35 +02:00
Jean-Sébastien Pédron f6a1661c72
Merge branch 'stable' 2017-08-10 15:03:08 +02:00
Jean-Sébastien Pédron f7641be403
debian/control: Use ${misc:Depends} instead of hard-coding dependencies
... which are added by debhelper. In this case, this is
init-system-helpers which is added by dh-systemd.

While here, bump the standard version to 3.9.6.

(cherry picked from commit 851561953a)
2017-08-10 15:02:01 +02:00
Jean-Sébastien Pédron 851561953a
debian/control: Use ${misc:Depends} instead of hard-coding dependencies
... which are added by debhelper. In this case, this is
init-system-helpers which is added by dh-systemd.

While here, bump the standard version to 3.9.6.
2017-08-10 14:59:10 +02:00
Markos Chandras 2d8de4c093
packaging: rpms: Add systemd support for openSUSE
Recent openSUSE releases have been migrated to systemd so use the
%{suse_version} macro to detect if we are building on openSUSE
so we can include the necessary systemd files and also perform the
needed systemd steps. This also defines the 'suse_version' to 1315
which is what openSUSE Leap 42.x use. This also drops the buggy rhel7
conditional for the sysvinit script and use another 'find' command
instead. The previous condition was wrong since it would also try
to include the sysvinit file on openSUSE and Fedora which do not
define the %rhel macro and as such the 0 < 7 conditional was always
true.

(cherry picked from commit 2211e5fe44)
2017-08-10 13:32:37 +02:00
Daniil Fedotov ea41a1cf6a Configure shortcuts to run as admin.
Shortcuts for `rabbitmq-service.bat` should run as admin
because system control tools require admin.
Also make shortcuts run a command prompt and do not exit if there
is an error, so the error can be seen by an operator.

Part of rabbitmq/rabbitmq-server#1324
[#149953545]
2017-08-08 17:26:27 +01:00
Jean-Sébastien Pédron c02877d6e8
Merge branch 'stable' 2017-08-03 16:42:21 +02:00
Jean-Sébastien Pédron 4ce314b062
packaging: Add scripts for format RabbitMQ version to match package constarints
I.e., for RPM and Debian, converts '-' to '~'.

[#131648373]
2017-08-03 16:39:33 +02:00
Jean-Sébastien Pédron 28266b17a4
Merge branch 'stable' 2017-08-03 11:24:11 +02:00
Jean-Sébastien Pédron 5c510175bd
packaging/debs/Debian/Makefile: Display Erlang version *after* installing it
In the old release build script, Erlang is already provided. However in
CI, Erlang is installed later in the Makefile recipe. Thus, display its
version only once we are sure Erlang is available.

(cherry picked from commit 5cb41b9434)
2017-08-03 11:23:48 +02:00
Jean-Sébastien Pédron 1195a9d014
packaging: Log the version of Erlang used to compile packages
This should help us diagnose situations where the version of Erlang used
to compile is greater than the minimum supported.

(cherry picked from commit 679518f911)
2017-08-03 11:23:33 +02:00
Jean-Sébastien Pédron 5cb41b9434
packaging/debs/Debian/Makefile: Display Erlang version *after* installing it
In the old release build script, Erlang is already provided. However in
CI, Erlang is installed later in the Makefile recipe. Thus, display its
version only once we are sure Erlang is available.
2017-08-03 11:13:49 +02:00
Jean-Sébastien Pédron 679518f911
packaging: Log the version of Erlang used to compile packages
This should help us diagnose situations where the version of Erlang used
to compile is greater than the minimum supported.
2017-08-03 10:42:47 +02:00
Jean-Sébastien Pédron d75d92ccd5
Merge branch 'stable' 2017-08-03 09:31:09 +02:00
Jean-Sébastien Pédron 3dc09be6a2
packaging/debs/apt-repository/distributions: Add `arm64` architecture 2017-08-03 09:29:43 +02:00
Jean-Sébastien Pédron 77f34b8897
packaging: Bump build/runtime requirement to Erlang 19.2
... for both Debian and RPM packages.

[#149744525]
2017-08-02 15:13:09 +02:00
Jean-Sébastien Pédron 7ec9512aa3
Merge branch 'stable' 2017-08-01 18:17:39 +02:00
Michael Klishin e6c1d41cb6 Merge pull request #36 from rabbitmq/run-rabbitmq-plugins-as-root
scripts/rabbitmq-script-wrapper: Run rabbitmq-plugin as root only
2017-08-01 18:35:53 +03:00
Jean-Sébastien Pédron ad1984130e
scripts/rabbitmq-script-wrapper: Run rabbitmq-plugin as root only
The previous patch was meant to make it clear that an unprivileged user
(other than `rabbitmq`) shouldn't run rabbitmq-plugins.

Unfortunately, it broke the script when called by root, because the
real script was executed as `rabbitmq`. This user doesn't have write
permissions to `/etc/rabbitmq` by default.

Now, rabbitmq-plugins' wrapper must be executed as root and so is the
real script. This should fix the problem described above.

[#149840153]
2017-08-01 15:35:35 +02:00
Jean-Sébastien Pédron 4d777d2138
Merge branch 'stable' 2017-07-31 18:33:57 +02:00
Jean-Sébastien Pédron 2f50f82bf5
packaging/*/rabbitmq-server.service: Wait for RabbitMQ to stop in ExecStop
systemd considers that, when the ExecStop commands exit, the service is
stopped. If there are remaining processes in the cgroup, they are
killed.

Unfortunately, `rabbitmqctl stop` doesn't wait for the Erlang VM to
exit, it just notifies RabbitMQ to stop. Because it doesn't wait,
systemd kills other processes such as `erl_child_setup`. When this
happens, the Erlang VM crashes (because it can't reach `erl_child_setup`
anymore) and the service enters the failed state in systemd. Note the
"erl_child_setup closed" message in the following output:

    [root@ip-172-31-29-47 package-testing]# systemctl status rabbitmq-server
    ● rabbitmq-server.service - RabbitMQ broker
       Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; disabled; vendor preset: disabled)
       Active: failed (Result: exit-code) since Mon 2017-07-31 14:54:42 UTC; 1s ago
      Process: 26763 ExecStop=/usr/sbin/rabbitmqctl stop (code=exited, status=0/SUCCESS)
      Process: 26398 ExecStart=/usr/sbin/rabbitmq-server (code=exited, status=1/FAILURE)
     Main PID: 26398 (code=exited, status=1/FAILURE)
       Status: "Initialized"

    Jul 31 14:54:30 ip-172-31-29-47 rabbitmq-server[26398]: completed with 0 plugins.
    Jul 31 14:54:40 ip-172-31-29-47 systemd[1]: Stopping RabbitMQ broker...
    Jul 31 14:54:41 ip-172-31-29-47 rabbitmqctl[26763]: Stopping and halting node 'rabbit@ip-172-31-29-47'
    Jul 31 14:54:41 ip-172-31-29-47 rabbitmq-server[26398]: Gracefully halting Erlang VM
    Jul 31 14:54:41 ip-172-31-29-47 rabbitmq-server[26398]: erl_child_setup closed
    Jul 31 14:54:42 ip-172-31-29-47 rabbitmq-server[26398]: Crash dump is being written to: erl_crash.dump...done
    Jul 31 14:54:42 ip-172-31-29-47 systemd[1]: rabbitmq-server.service: main process exited, code=exited, status=1/FAILURE
    Jul 31 14:54:42 ip-172-31-29-47 systemd[1]: Stopped RabbitMQ broker.
    Jul 31 14:54:42 ip-172-31-29-47 systemd[1]: Unit rabbitmq-server.service entered failed state.
    Jul 31 14:54:42 ip-172-31-29-47 systemd[1]: rabbitmq-server.service failed.

Now, we add a second ExecStop which simply waits for the Erlang VM PID
to disappear. This looks to fix the issue.

[#149807109]
2017-07-31 18:33:38 +02:00
Jean-Sébastien Pédron 39766d7c05
Merge branch 'rabbitmq-script-wrapper-refactor' 2017-07-28 19:35:11 +02:00
Jean-Sébastien Pedron 9de5b86e00 Ensure we are in a readable dir when running RabbitMQ scripts
If the current working directory is not readable, Erlang will crash.
This ensures that we run RabbitMQ scripts from a readable directory.

[#149425921]

Signed-off-by: Gerhard Lazu <gerhard@rabbitmq.com>
2017-07-28 18:32:49 +01:00
Jean-Sébastien Pedron cf7baacd03 Refactor rabbitmq-script-wrapper
The logic is a bit crazy, and the whole purpose of this script is
questionable, but until we get rid of it, we've refactor it to make it
more obvious just how crazy it actually is.

[#149425921]

Signed-off-by: Gerhard Lazu <gerhard@rabbitmq.com>
2017-07-28 17:06:46 +01:00
Gerhard Lazu 0eb3736a63 Merge branch 'stable' 2017-07-28 17:06:01 +01:00
Gerhard Lazu 34f53e7d39 Merge pull request #33 from rabbitmq/rabbitmq-server-release-rabbitmq-plugins-wrapper-require-root
Require root or rabbitmq user for rabbitmq-plugins.
2017-07-28 17:03:53 +01:00
Michael Klishin abb7a490bd
Update rabbitmq-components.mk 2017-07-26 03:48:38 +03:00
Michael Klishin dc5e60075b
Merge branch 'stable' 2017-07-26 03:30:58 +03:00
Michael Klishin 95231354bb
Update rabbitmq-components.mk 2017-07-26 02:27:15 +03:00
Daniil Fedotov 2c5f833d98 Require root or rabbitmq user for rabbitmq-plugins.
For some reason, the rabbitmq-plugins command could be run
from arbitrary user, which would result in errors unable to
access a cookie file or plugins configuration files.
Changed to work the same way as rabbitmqctl - require root
or rabbitmq user.

[Fixes #149425921]
2017-07-24 17:50:11 +01:00
Jean-Sébastien Pédron 6cd251c19a
debian/control: Depend on erlang-dev and elixir
erlang-dev was missing (but present in `stable` branch), so probably a
mismerge.

elixir was missing and we require it for RabbitMQ 3.7.x.

[#131645781]
2017-07-19 15:04:07 +02:00
Jean-Sébastien Pédron 95132fa0a7
Merge branch 'stable' 2017-07-19 14:56:22 +02:00
Jean-Sébastien Pédron 18263db71c
debian/control: Depend on erlang-src
We need a private header in `lib/ssl-*/src`.
2017-07-19 14:40:03 +02:00
Jean-Sébastien Pédron 44f2dddc83
debian/control: Try with erlang-nox 1:16.b.3-3
The erlang-* 1:16.b.3 packages family (note the absence of the package
revision) was only partially uploaded to the Erlang Solutions Debian
repository... For instance, we have erlang-nox 1:16.b.3 and 1:16.b.3-3,
but only erlang-base 1:16.b.3-3 :-/

[#131645781]
2017-07-19 14:27:29 +02:00
Jean-Sébastien Pédron 249fb6d1f6
debian/control: Add version restriction on erlang-dev and esl-erlang 2017-07-19 13:51:56 +02:00
Jean-Sébastien Pédron f466ed75e2
packaging/debs/Debian/Makefile: Install build dependencies
We use mk-build-deps(1) from the `devscripts` package to help us with
this. This helper script looks at `debian/control` and creates a
meta-package which depends on the build dependencies. Then we only have to
install it to get those dependencies.

We only do this if `$(INSTALL_BUILD_DEPS)` is set to `yes`. We want to
use this feature in CI, but not with the old build script where we cheat
a lot around Erlang and Elixir packages.

[#131645781]
2017-07-19 10:56:16 +02:00
Jean-Sébastien Pédron 838e365c75
packaging/debs/Debian/Makefile: Use cp(1) instead of rsync(1)
We don't need the full power of rsync(1) here and this removes a
dependency on a possibly non-default package.
2017-07-19 10:54:55 +02:00