Commit Graph

134 Commits

Author SHA1 Message Date
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
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
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 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 3dc09be6a2
packaging/debs/apt-repository/distributions: Add `arm64` architecture 2017-08-03 09:29:43 +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 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
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 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 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
Jean-Sébastien Pédron cd822d1ed8 Merge pull request #30 from rabbitmq/rabbitmq-server_1129
Add chmod g+s to /etc/rabbitmq
2017-06-26 12:17:38 +02:00
Gabriele Santomaggio 5df0873777 Change to 2750 2017-06-23 12:27:08 +02:00
Gabriele Santomaggio ada3834633 Add chmod g+s to rpm spec 2017-06-22 14:44:45 +02:00
Gabriele Santomaggio fecde3e918 Add chmod g+s to /etc/rabbitmq 2017-06-22 08:54:38 +02:00
Michael Klishin c981877186
Update rabbitmq-components.mk 2017-06-12 18:35:48 +03:00
Michael Klishin 01f49ae603
Update rabbitmq-components.mk 2017-06-02 17:51:34 +03:00
Michael Klishin 4c22c76361
Update rabbitmq-components.mk 2017-06-02 00:43:31 +03:00
Michael Klishin 62513438d9 Commit .deb and .rpm change logs 2017-05-25 12:57:46 +01:00
Jean-Sébastien Pédron 122123aedd
Update erlang.mk 2017-05-16 17:37:25 +02:00
Michael Klishin 331bcecf8b Merge pull request #29 from matelakat/fix-ocf-scripts
Fix HA OCF script
2017-05-09 16:45:13 +03:00
Mate Lakat 8efde0e212 Fix HA OCF script
Some parts of #21 have not been added to the stable branch. This change
fixes the issue by adding missing changes to rabbitmq-server-ha.ocf and
also fixing rabbitmq-server.ocf
2017-05-09 15:39:29 +02:00
Michael Klishin cf05aed5c9 Merge pull request #28 from matelakat/minor-comment-fix
Enlist OCF_RESKEY_limit_nofile_default on comment
2017-05-09 15:28:14 +03:00
Mate Lakat b675606fa2 Enlist OCF_RESKEY_limit_nofile_default on comment
Minor change to be consistent with the rest of the file.
2017-05-09 14:19:37 +02:00
Mate Lakat 16ca1ccf4e
Re-do #21
For some reason some changes were lost from #21, adding back those.

The original PR message:
This enables to change the limit of open files, as the default on
distributions is usually too low for rabbitmq. Default is 65535.
2017-05-09 13:51:12 +03:00
Mate Lakat 04ddf74032
Log rabbitmqctl's output on failure
It would be helpful to see rabbit's output when it exits with non-zero
status code. The log level is left at info, as it might be business as
usual that a node is not running rabbit. The -q switch prevents the
output from being logged if the return value is zero.
2017-05-03 12:51:05 +02:00
Jean-Sébastien Pédron c1f989902f
Update erlang.mk 2017-04-19 12:04:37 +02:00
jerryk 72b0308ca3 Remove. 2017-04-16 18:11:49 -07:00
jerryk 0106c43a7f Placeholder, remove later. 2017-04-16 17:47:30 -07:00
Gerhard Lazu 7a1ee1c1e3 Ignore .envrc files
I'm using direnv to set XML_CATALOG_FILES so that I can compile on OS X
2017-04-13 12:34:36 +01:00
Michael Klishin 46ffbfa350 Commit 3.6.9 package change logs 2017-04-12 10:30:09 +01:00
Michael Klishin 054c72d6dd
Manually backport #20, #21, #24, #25 by @vuntz and @aplanas to stable 2017-04-05 17:54:43 +03:00
Alberto Planas d2d5d5e893
OCF RA: Add new limit_nofile parameter to rabbitmq-server OCF RA
This enables to change the limit of open files, as the default on
distributions is usually too low for rabbitmq. Default is 65535.
2017-04-05 17:50:23 +03:00
Jean-Sébastien Pédron eb5aef3178
README.md: Document how Windows' PRODUCTVERSION is computed by default
[#142391637]
2017-04-05 12:51:42 +02:00
Vincent Untz 564a54a168
OCF RA: Don't hardcode primitive name in rabbitmq-server-ha.ocf
We can compute the name of the primitive automatically from environment
variables, instead of hard-coding p_rabbitmq-server; this makes the
resource agent more flexible.

Closes https://github.com/rabbitmq/rabbitmq-server-release/issues/23
2017-03-31 19:29:41 +03:00
Vincent Untz 49f4c4b566
OCF RA: accept 1 as valid exit code from "rabbitmqctl status"
It may return 1 if the server is not completely running yet, and we
don't want pacemaker to treat that as a complete unexpected error.
2017-03-31 14:28:09 +03:00
Vincent Untz 35bba6f8ad
OCF RA: Use rabbitmqctl_action wrapper for stop action
We want to use the wrapper function to call rabbitmqctl for stop, so
that we interpret correctly the exit code.
2017-03-31 14:28:01 +03:00
Jean-Sébastien Pédron f66087ee6c
README.md: Document how to build the source archive and packages
[#142391637]
2017-03-28 12:00:24 +02:00
Jean-Sébastien Pédron bd14baae96
packaging/windows: Try to compute a valid default `PRODUCTVERSION`
The `PRODUCTVERSION` must be four integers. So try to replace
everything following the first three integers in the the
semver-formatted `$(VERSION)` by `.0`. For instance if `$(VERSION)` is
`3.6.8+1.g1dcb221`, `PRODUCTVERSION` will be set to `3.6.8.0`.

This should make Windows installer builds successful out-of-the-box.

This is still possible to override this behavior by setting the
`$(PRODUCT_VERSION)` Make variable.

[#142391637]
2017-03-28 11:45:58 +02:00
Michael Klishin 1dcb2211d1 Commit .deb and .rpm change logs 2017-03-17 12:16:00 +00:00
Jean-Sébastien Pédron 52c67750db
packaging/standalone: Copy `start_clean.boot` to bin driectory
This boot script is required by escript(1). Without it, escript(1) fails
with the following error:

    {"init terminating in do_boot",{'cannot get bootfile','start_clean.boot'}}
    init terminating in do_boot ()

[#141679931]

(cherry picked from commit 7ffe744d66)
2017-03-16 09:33:57 +01:00
Jean-Sébastien Pédron 276ac72801
packaging/standalone: Fix path to the source `rabbit.rel` file
[#141674113]

(cherry picked from commit 44f41f02eb)
2017-03-16 09:33:57 +01:00
Jean-Sébastien Pédron 4caa7328bc
packaging/standalone: Remove the source `rabbit.rel` file
It is copied to the release directory, we don't need to keep the initial
file.

[#141674113]

(cherry picked from commit b7fadb7959)
2017-03-16 09:33:56 +01:00
Jean-Sébastien Pédron f2bd0e4d4d
packaging/standalone: Do not use NUL-separated filenames in manifest
tar(1) expects one file per line which is fine in our case.

[#141674113]

(cherry picked from commit feb07cf610)
2017-03-16 09:33:56 +01:00