summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2016-09-21 16:42:32 +0200
committerJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2016-09-21 16:43:08 +0200
commit35d6c0349b692bc3b745b46a743ec7b83c04e0fb (patch)
treee5040ed77ee85b5509ec827377a165f307c0754e
parentddecc0416338a881d24beed556de5e774081195d (diff)
downloadrabbitmq-server-git-35d6c0349b692bc3b745b46a743ec7b83c04e0fb.tar.gz
Move all release handling bits to rabbitmq-release
[#130659985]
-rw-r--r--.gitignore9
-rw-r--r--Makefile210
-rw-r--r--packaging/Makefile108
-rw-r--r--packaging/RPMS/Fedora/Makefile80
-rw-r--r--packaging/RPMS/Fedora/rabbitmq-server.init184
-rw-r--r--packaging/RPMS/Fedora/rabbitmq-server.logrotate12
-rw-r--r--packaging/RPMS/Fedora/rabbitmq-server.service16
-rw-r--r--packaging/RPMS/Fedora/rabbitmq-server.spec415
-rw-r--r--packaging/RPMS/Fedora/rabbitmq-server.tmpfiles1
-rw-r--r--packaging/common/LICENSE.head5
-rw-r--r--packaging/common/LICENSE.tail516
-rw-r--r--packaging/debs/Debian/.gitignore3
-rw-r--r--packaging/debs/Debian/Makefile57
-rw-r--r--packaging/debs/Debian/changelog_comments/additional_changelog_comments_3.3.59
-rw-r--r--packaging/debs/Debian/changelog_comments/additional_changelog_comments_x.x.x11
-rwxr-xr-xpackaging/debs/Debian/check-changelog.sh29
-rw-r--r--packaging/debs/Debian/debian/changelog427
-rw-r--r--packaging/debs/Debian/debian/compat1
-rw-r--r--packaging/debs/Debian/debian/control24
-rw-r--r--packaging/debs/Debian/debian/copyright52
-rw-r--r--packaging/debs/Debian/debian/dirs9
-rw-r--r--packaging/debs/Debian/debian/postinst62
-rw-r--r--packaging/debs/Debian/debian/postrm.in65
-rw-r--r--packaging/debs/Debian/debian/rabbitmq-server.default9
-rw-r--r--packaging/debs/Debian/debian/rabbitmq-server.docs2
-rw-r--r--packaging/debs/Debian/debian/rabbitmq-server.init191
-rw-r--r--packaging/debs/Debian/debian/rabbitmq-server.logrotate12
-rw-r--r--packaging/debs/Debian/debian/rabbitmq-server.manpages4
-rw-r--r--packaging/debs/Debian/debian/rabbitmq-server.service18
-rwxr-xr-xpackaging/debs/Debian/debian/rules57
-rw-r--r--packaging/debs/Debian/debian/source/format1
-rw-r--r--packaging/debs/Debian/debian/watch4
-rw-r--r--packaging/debs/apt-repository/Makefile31
-rw-r--r--packaging/debs/apt-repository/README17
-rw-r--r--packaging/debs/apt-repository/README-real-repository130
-rw-r--r--packaging/debs/apt-repository/distributions7
-rw-r--r--packaging/debs/apt-repository/dupload.conf16
-rw-r--r--packaging/generic-unix/Makefile58
-rw-r--r--packaging/standalone/Makefile123
-rw-r--r--packaging/standalone/erl.diff4
-rw-r--r--packaging/standalone/src/rabbit_release.erl160
-rw-r--r--packaging/windows-exe/Makefile33
-rw-r--r--packaging/windows-exe/plugins/ExecDos.dllbin6656 -> 0 bytes
-rw-r--r--packaging/windows-exe/rabbitmq.icobin4286 -> 0 bytes
-rw-r--r--packaging/windows-exe/rabbitmq_nsi.in272
-rw-r--r--packaging/windows/Makefile43
-rw-r--r--packaging/windows/README-etc7
-rw-r--r--scripts/rabbitmq-script-wrapper47
-rwxr-xr-xscripts/rabbitmq-server-ha.ocf2328
-rwxr-xr-xscripts/rabbitmq-server.ocf371
-rw-r--r--scripts/travis_test_ocf_ra.sh30
51 files changed, 6 insertions, 6274 deletions
diff --git a/.gitignore b/.gitignore
index 7582deb64e..52a0257b62 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,8 +15,6 @@
/test/ct.cover.spec
/xrefr
-PACKAGES/
-
rabbit.d
# Generated sources files.
@@ -35,13 +33,6 @@ docs/rabbitmq-service.man.xml
docs/rabbitmqctl.1
docs/rabbitmqctl.1.man.xml
-# Source distribution.
-rabbitmq-server-*/
-rabbitmq-server-*.tar.gz
-rabbitmq-server-*.tar.bz2
-rabbitmq-server-*.tar.xz
-rabbitmq-server-*.zip
-
# Dialyzer
*.plt
diff --git a/Makefile b/Makefile
index 74d6053adb..b3603dcf8f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,6 @@
PROJECT = rabbit
VERSION ?= $(call get_app_version,src/$(PROJECT).app.src)
-# Release artifacts are put in $(PACKAGES_DIR).
-PACKAGES_DIR ?= $(abspath PACKAGES)
-
DEPS = ranch rabbit_common
TEST_DEPS = rabbitmq_ct_helpers amqp_client meck proper
@@ -34,41 +31,6 @@ ERLANG_MK_REPO = https://github.com/rabbitmq/erlang.mk.git
ERLANG_MK_COMMIT = rabbitmq-tmp
include rabbitmq-components.mk
-
-# List of plugins to include in a RabbitMQ release.
-DISTRIBUTED_DEPS := rabbitmq_amqp1_0 \
- rabbitmq_auth_backend_ldap \
- rabbitmq_auth_mechanism_ssl \
- rabbitmq_consistent_hash_exchange \
- rabbitmq_event_exchange \
- rabbitmq_federation \
- rabbitmq_federation_management \
- rabbitmq_jms_topic_exchange \
- rabbitmq_management \
- rabbitmq_management_agent \
- rabbitmq_management_visualiser \
- rabbitmq_mqtt \
- rabbitmq_recent_history_exchange \
- rabbitmq_sharding \
- rabbitmq_shovel \
- rabbitmq_shovel_management \
- rabbitmq_stomp \
- rabbitmq_top \
- rabbitmq_tracing \
- rabbitmq_trust_store \
- rabbitmq_web_dispatch \
- rabbitmq_web_stomp \
- rabbitmq_web_stomp_examples
-
-ifneq ($(IS_DEP),1)
-ifneq ($(filter source-dist packages package-%,$(MAKECMDGOALS)),)
-DEPS += $(DISTRIBUTED_DEPS)
-endif
-ifneq ($(wildcard git-revisions.txt),)
-DEPS += $(DISTRIBUTED_DEPS)
-endif
-endif
-
include erlang.mk
# --------------------------------------------------------------------
@@ -156,147 +118,6 @@ distclean-manpages::
$(gen_verbose) rm -f $(MANPAGES) $(WEB_MANPAGES)
# --------------------------------------------------------------------
-# Distribution.
-# --------------------------------------------------------------------
-
-.PHONY: source-dist clean-source-dist
-
-SOURCE_DIST_BASE ?= rabbitmq-server
-SOURCE_DIST_SUFFIXES ?= tar.xz zip
-SOURCE_DIST ?= $(PACKAGES_DIR)/$(SOURCE_DIST_BASE)-$(VERSION)
-
-# The first source distribution file is used by packages: if the archive
-# type changes, you must update all packages' Makefile.
-SOURCE_DIST_FILES = $(addprefix $(SOURCE_DIST).,$(SOURCE_DIST_SUFFIXES))
-
-.PHONY: $(SOURCE_DIST_FILES)
-
-source-dist: $(SOURCE_DIST_FILES)
- @:
-
-RSYNC ?= rsync
-RSYNC_V_0 =
-RSYNC_V_1 = -v
-RSYNC_V_2 = -v
-RSYNC_V = $(RSYNC_V_$(V))
-RSYNC_FLAGS += -a $(RSYNC_V) \
- --exclude '.sw?' --exclude '.*.sw?' \
- --exclude '*.beam' \
- --exclude '*.pyc' \
- --exclude '.git*' \
- --exclude '.hg*' \
- --exclude '.travis.yml' \
- --exclude '.*.plt' \
- --exclude '$(notdir $(ERLANG_MK_TMP))' \
- --exclude 'ebin' \
- --exclude 'packaging' \
- --exclude 'erl_crash.dump' \
- --exclude 'MnesiaCore.*' \
- --exclude 'cover/' \
- --exclude 'deps/' \
- --exclude '$(notdir $(DEPS_DIR))/' \
- --exclude 'plugins/' \
- --exclude '$(notdir $(DIST_DIR))/' \
- --exclude '/$(notdir $(PACKAGES_DIR))/' \
- --exclude '/PACKAGES/' \
- --exclude '/cowboy/doc/' \
- --exclude '/cowboy/examples/' \
- --exclude '/rabbitmq_amqp1_0/test/swiftmq/build/'\
- --exclude '/rabbitmq_amqp1_0/test/swiftmq/swiftmq*'\
- --exclude '/rabbitmq_mqtt/test/build/' \
- --exclude '/rabbitmq_mqtt/test/test_client/'\
- --delete \
- --delete-excluded
-
-TAR ?= tar
-TAR_V_0 =
-TAR_V_1 = -v
-TAR_V_2 = -v
-TAR_V = $(TAR_V_$(V))
-
-GZIP ?= gzip
-BZIP2 ?= bzip2
-XZ ?= xz
-
-ZIP ?= zip
-ZIP_V_0 = -q
-ZIP_V_1 =
-ZIP_V_2 =
-ZIP_V = $(ZIP_V_$(V))
-
-.PHONY: $(SOURCE_DIST)
-
-$(SOURCE_DIST): $(ERLANG_MK_RECURSIVE_DEPS_LIST)
- $(verbose) mkdir -p $(dir $@)
- $(gen_verbose) $(RSYNC) $(RSYNC_FLAGS) ./ $@/
- $(verbose) sed -E -i.bak \
- -e 's/[{]vsn[[:blank:]]*,[^}]+}/{vsn, "$(VERSION)"}/' \
- $@/src/$(PROJECT).app.src && \
- rm $@/src/$(PROJECT).app.src.bak
- $(verbose) cat packaging/common/LICENSE.head > $@/LICENSE
- $(verbose) mkdir -p $@/deps/licensing
- $(verbose) for dep in $$(cat $(ERLANG_MK_RECURSIVE_DEPS_LIST) | grep -v '/$(PROJECT)$$' | LC_COLLATE=C sort); do \
- $(RSYNC) $(RSYNC_FLAGS) \
- $$dep \
- $@/deps; \
- if test -f $@/deps/$$(basename $$dep)/erlang.mk && \
- test "$$(wc -l $@/deps/$$(basename $$dep)/erlang.mk | awk '{print $$1;}')" = "1" && \
- grep -qs -E "^[[:blank:]]*include[[:blank:]]+(erlang\.mk|.*/erlang\.mk)$$" $@/deps/$$(basename $$dep)/erlang.mk; then \
- echo "include ../../erlang.mk" > $@/deps/$$(basename $$dep)/erlang.mk; \
- fi; \
- sed -E -i.bak "s|^[[:blank:]]*include[[:blank:]]+\.\./.*erlang.mk$$|include ../../erlang.mk|" \
- $@/deps/$$(basename $$dep)/Makefile && \
- rm $@/deps/$$(basename $$dep)/Makefile.bak; \
- if test -f "$$dep/license_info"; then \
- cp "$$dep/license_info" "$@/deps/licensing/license_info_$$(basename "$$dep")"; \
- cat "$$dep/license_info" >> $@/LICENSE; \
- fi; \
- find "$$dep" -maxdepth 1 -name 'LICENSE-*' -exec cp '{}' $@/deps/licensing \; ; \
- done
- $(verbose) cat packaging/common/LICENSE.tail >> $@/LICENSE
- $(verbose) find $@/deps/licensing -name 'LICENSE-*' -exec cp '{}' $@ \;
- $(verbose) for file in $$(find $@ -name '*.app.src'); do \
- sed -E -i.bak -e 's/[{]vsn[[:blank:]]*,[[:blank:]]*""[[:blank:]]*}/{vsn, "$(VERSION)"}/' $$file; \
- rm $$file.bak; \
- done
- $(verbose) echo "$(PROJECT) $$(git rev-parse HEAD) $$(git describe --tags --exact-match 2>/dev/null || git symbolic-ref -q --short HEAD)" > $@/git-revisions.txt
- $(verbose) for dep in $$(cat $(ERLANG_MK_RECURSIVE_DEPS_LIST)); do \
- (cd $$dep; echo "$$(basename "$$dep") $$(git rev-parse HEAD) $$(git describe --tags --exact-match 2>/dev/null || git symbolic-ref -q --short HEAD)") >> $@/git-revisions.txt; \
- done
-
-# TODO: Fix file timestamps to have reproducible source archives.
-# $(verbose) find $@ -not -name 'git-revisions.txt' -print0 | xargs -0 touch -r $@/git-revisions.txt
-
-$(SOURCE_DIST).tar.gz: $(SOURCE_DIST)
- $(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
- find $(notdir $(SOURCE_DIST)) -print0 | LC_COLLATE=C sort -z | \
- xargs -0 $(TAR) $(TAR_V) --no-recursion -cf - | \
- $(GZIP) --best > $@
-
-$(SOURCE_DIST).tar.bz2: $(SOURCE_DIST)
- $(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
- find $(notdir $(SOURCE_DIST)) -print0 | LC_COLLATE=C sort -z | \
- xargs -0 $(TAR) $(TAR_V) --no-recursion -cf - | \
- $(BZIP2) > $@
-
-$(SOURCE_DIST).tar.xz: $(SOURCE_DIST)
- $(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
- find $(notdir $(SOURCE_DIST)) -print0 | LC_COLLATE=C sort -z | \
- xargs -0 $(TAR) $(TAR_V) --no-recursion -cf - | \
- $(XZ) > $@
-
-$(SOURCE_DIST).zip: $(SOURCE_DIST)
- $(verbose) rm -f $@
- $(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
- find $(notdir $(SOURCE_DIST)) -print0 | LC_COLLATE=C sort -z | \
- xargs -0 $(ZIP) $(ZIP_V) $@
-
-clean:: clean-source-dist
-
-clean-source-dist:
- $(gen_verbose) rm -rf -- $(SOURCE_DIST_BASE)-*
-
-# --------------------------------------------------------------------
# Installation.
# --------------------------------------------------------------------
@@ -335,12 +156,12 @@ inst_verbose = $(inst_verbose_$(V))
install: install-erlapp install-scripts
-install-erlapp: dist
+install-erlapp:
$(verbose) mkdir -p $(DESTDIR)$(RMQ_ERLAPP_DIR)
- $(inst_verbose) cp -r include ebin plugins LICENSE* INSTALL \
+ $(inst_verbose) cp -r include ebin LICENSE* INSTALL $(PLUGINS_DIST_DIR) \
$(DESTDIR)$(RMQ_ERLAPP_DIR)
$(verbose) echo "Put your EZs here and use rabbitmq-plugins to enable them." \
- > $(DESTDIR)$(RMQ_ERLAPP_DIR)/plugins/README
+ > $(DESTDIR)$(RMQ_ERLAPP_DIR)/$(notdir $(PLUGINS_DIST_DIR))/README
@# rabbitmq-common provides headers too: copy them to
@# rabbitmq_server/include.
@@ -376,12 +197,12 @@ install-man: manpages
install-windows: install-windows-erlapp install-windows-scripts install-windows-docs
-install-windows-erlapp: dist
+install-windows-erlapp:
$(verbose) mkdir -p $(DESTDIR)$(WINDOWS_PREFIX)
- $(inst_verbose) cp -r include ebin plugins LICENSE* INSTALL \
+ $(inst_verbose) cp -r include ebin LICENSE* INSTALL $(PLUGINS_DIST_DIR) \
$(DESTDIR)$(WINDOWS_PREFIX)
$(verbose) echo "Put your EZs here and use rabbitmq-plugins.bat to enable them." \
- > $(DESTDIR)$(WINDOWS_PREFIX)/plugins/README.txt
+ > $(DESTDIR)$(WINDOWS_PREFIX)/$(notdir $(PLUGINS_DIST_DIR))/README.txt
$(verbose) $(UNIX_TO_DOS) $(DESTDIR)$(WINDOWS_PREFIX)/plugins/README.txt
# rabbitmq-common provides headers too: copy them to
@@ -412,22 +233,3 @@ install-windows-docs: install-windows-erlapp
*) mv "$$file" "$$file.txt" ;; \
esac; \
done
-
-# --------------------------------------------------------------------
-# Packaging.
-# --------------------------------------------------------------------
-
-.PHONY: packages package-deb \
- package-rpm package-rpm-fedora package-rpm-suse \
- package-windows package-standalone-macosx \
- package-generic-unix
-
-# This variable is exported so sub-make instances know where to find the
-# archive.
-PACKAGES_SOURCE_DIST_FILE ?= $(firstword $(SOURCE_DIST_FILES))
-
-packages package-deb package-rpm package-rpm-fedora \
-package-rpm-suse package-windows package-standalone-macosx \
-package-generic-unix: $(PACKAGES_SOURCE_DIST_FILE)
- $(verbose) $(MAKE) -C packaging $@ \
- SOURCE_DIST_FILE=$(abspath $(PACKAGES_SOURCE_DIST_FILE))
diff --git a/packaging/Makefile b/packaging/Makefile
deleted file mode 100644
index 64a1243b51..0000000000
--- a/packaging/Makefile
+++ /dev/null
@@ -1,108 +0,0 @@
-# Platform detection.
-
-ifeq ($(PLATFORM),)
-UNAME_S := $(shell uname -s)
-
-ifeq ($(UNAME_S),Linux)
-PLATFORM = linux
-else ifeq ($(UNAME_S),Darwin)
-PLATFORM = darwin
-else ifeq ($(UNAME_S),SunOS)
-PLATFORM = solaris
-else ifeq ($(UNAME_S),GNU)
-PLATFORM = gnu
-else ifeq ($(UNAME_S),FreeBSD)
-PLATFORM = freebsd
-else ifeq ($(UNAME_S),NetBSD)
-PLATFORM = netbsd
-else ifeq ($(UNAME_S),OpenBSD)
-PLATFORM = openbsd
-else ifeq ($(UNAME_S),DragonFly)
-PLATFORM = dragonfly
-else ifeq ($(shell uname -o),Msys)
-PLATFORM = msys2
-else
-$(error Unable to detect platform. Please open a ticket with the output of uname -a.)
-endif
-endif
-
-all: packages
- @:
-
-# --------------------------------------------------------------------
-# Packaging.
-# --------------------------------------------------------------------
-
-.PHONY: packages package-deb \
- package-rpm package-rpm-fedora package-rpm-suse \
- package-rpm-rhel6 package-rpm-rhel7 \
- package-windows package-standalone-macosx \
- package-generic-unix
-
-PACKAGES_DIR ?= ../PACKAGES
-SOURCE_DIST_FILE ?= $(wildcard $(PACKAGES_DIR)/rabbitmq-server-*.tar.xz)
-
-ifneq ($(filter-out clean,$(MAKECMDGOALS)),)
-ifeq ($(SOURCE_DIST_FILE),)
-$(error Cannot find source archive; please specify SOURCE_DIST_FILE)
-endif
-ifneq ($(words $(SOURCE_DIST_FILE)),1)
-$(error Multiple source archives found; please specify SOURCE_DIST_FILE)
-endif
-ifeq ($(filter %.tar.xz %.txz,$(SOURCE_DIST_FILE)),)
-$(error The source archive must a tar.xz archive)
-endif
-ifeq ($(wildcard $(SOURCE_DIST_FILE)),)
-$(error The source archive must exist)
-endif
-endif
-
-ifndef NO_CLEAN
-DO_CLEAN := clean
-endif
-
-VARS = SOURCE_DIST_FILE="$(abspath $(SOURCE_DIST_FILE))" \
- PACKAGES_DIR="$(abspath $(PACKAGES_DIR))" \
- SIGNING_KEY="$(SIGNING_KEY)"
-
-packages: package-deb package-rpm package-windows package-generic-unix
- @:
-
-package-deb: $(SOURCE_DIST_FILE)
- $(gen_verbose) $(MAKE) -C debs/Debian $(VARS) all $(DO_CLEAN)
-
-package-rpm: package-rpm-rhel6 package-rpm-rhel7 package-rpm-suse
- @:
-
-package-rpm-fedora: $(SOURCE_DIST_FILE)
- $(gen_verbose) $(MAKE) -C RPMS/Fedora $(VARS) all $(DO_CLEAN)
-
-package-rpm-rhel6: $(SOURCE_DIST_FILE)
- $(gen_verbose) $(MAKE) -C RPMS/Fedora $(VARS) RPM_OS=rhel6 all $(DO_CLEAN)
-
-package-rpm-rhel7: $(SOURCE_DIST_FILE)
- $(gen_verbose) $(MAKE) -C RPMS/Fedora $(VARS) RPM_OS=rhel7 all $(DO_CLEAN)
-
-package-rpm-suse: $(SOURCE_DIST_FILE)
- $(gen_verbose) $(MAKE) -C RPMS/Fedora $(VARS) RPM_OS=suse all $(DO_CLEAN)
-
-package-windows: $(SOURCE_DIST_FILE)
- $(gen_verbose) $(MAKE) -C windows $(VARS) all $(DO_CLEAN)
- $(verbose) $(MAKE) -C windows-exe $(VARS) all $(DO_CLEAN)
-
-package-generic-unix: $(SOURCE_DIST_FILE)
- $(gen_verbose) $(MAKE) -C generic-unix $(VARS) all $(DO_CLEAN)
-
-ifeq ($(PLATFORM),darwin)
-packages: package-standalone-macosx
-
-package-standalone-macosx: $(SOURCE_DIST_FILE)
- $(gen_verbose) $(MAKE) -C standalone $(VARS) OS=mac all $(DO_CLEAN)
-endif
-
-.PHONY: clean
-
-clean:
- for subdir in debs/Debian RPMS/Fedora windows windows-exe generic-unix standalone; do \
- $(MAKE) -C "$$subdir" clean; \
- done
diff --git a/packaging/RPMS/Fedora/Makefile b/packaging/RPMS/Fedora/Makefile
deleted file mode 100644
index 11ecaff652..0000000000
--- a/packaging/RPMS/Fedora/Makefile
+++ /dev/null
@@ -1,80 +0,0 @@
-SOURCE_DIST_FILE ?= $(wildcard ../../../rabbitmq-server-*.tar.xz)
-
-ifneq ($(filter-out clean,$(MAKECMDGOALS)),)
-ifeq ($(SOURCE_DIST_FILE),)
-$(error Cannot find source archive; please specify SOURCE_DIST_FILE)
-endif
-ifneq ($(words $(SOURCE_DIST_FILE)),1)
-$(error Multiple source archives found; please specify SOURCE_DIST_FILE)
-endif
-
-VERSION ?= $(patsubst rabbitmq-server-%.tar.xz,%,$(notdir $(SOURCE_DIST_FILE)))
-ifeq ($(VERSION),)
-$(error Cannot determine version; please specify VERSION)
-endif
-endif
-
-TOP_DIR = $(shell pwd)
-# Under debian we do not want to check build dependencies, since that
-# only checks build-dependencies using rpms, not debs
-DEFINES = --define '_topdir $(TOP_DIR)' --define '_tmppath $(TOP_DIR)/tmp' \
- --define '_sysconfdir /etc' --define '_localstatedir /var'
-
-ifndef RPM_OS
-RPM_OS = fedora
-endif
-
-ifeq "$(RPM_OS)" "suse"
-FUNCTION_LIBRARY=
-REQUIRES=/sbin/chkconfig /sbin/service
-OS_DEFINES=--define '_initrddir /etc/init.d' --define 'dist .suse'
-SPEC_DEFINES=--define 'group_tag Productivity/Networking/Other'
-START_PROG=startproc
-else
-FUNCTION_LIBRARY=\# Source function library.\n. /etc/init.d/functions
-REQUIRES=chkconfig initscripts
-OS_DEFINES=--define '_initrddir /etc/rc.d/init.d'
-ifeq "$(RPM_OS)" "rhel6"
-SPEC_DEFINES=--define 'group_tag Development/Libraries' --define 'dist .el6' --define 'rhel 6'
-else ifeq "$(RPM_OS)" "rhel7"
-SPEC_DEFINES=--define 'group_tag Development/Libraries' --define '_unitdir /usr/lib/systemd/system' --define 'dist .el7' --define 'rhel 7'
-else
-SPEC_DEFINES=--define 'group_tag Development/Libraries'
-endif
-START_PROG=daemon
-endif
-
-unexport DEPS_DIR
-unexport ERL_LIBS
-
-.PHONY: all prepare server clean
-
-all: clean server
- @:
-
-prepare:
- mkdir -p BUILD SOURCES SPECS SRPMS RPMS tmp
- cp $(SOURCE_DIST_FILE) SOURCES
- cp rabbitmq-server.spec SPECS
- sed -i 's|%%VERSION%%|$(VERSION)|;s|%%REQUIRES%%|$(REQUIRES)|' \
- SPECS/rabbitmq-server.spec
-
- cp rabbitmq-server.service SOURCES/rabbitmq-server.service
- cp rabbitmq-server.tmpfiles SOURCES/rabbitmq-server.tmpfiles
- cp rabbitmq-server.init SOURCES/rabbitmq-server.init
- sed -i \
- -e 's|^START_PROG=.*$$|START_PROG="$(START_PROG)"|' \
- -e 's|^@FUNCTION_LIBRARY@|$(FUNCTION_LIBRARY)|' \
- SOURCES/rabbitmq-server.init
- cp rabbitmq-server.logrotate SOURCES/rabbitmq-server.logrotate
-
-server: prepare
- rpmbuild -ba --nodeps SPECS/rabbitmq-server.spec $(DEFINES) $(OS_DEFINES) $(SPEC_DEFINES)
-
- if test "$(PACKAGES_DIR)"; then \
- mkdir -p "$(PACKAGES_DIR)"; \
- mv SRPMS/*.rpm RPMS/noarch/*.rpm "$(PACKAGES_DIR)"; \
- fi
-
-clean:
- rm -rf SOURCES SPECS RPMS SRPMS BUILD tmp
diff --git a/packaging/RPMS/Fedora/rabbitmq-server.init b/packaging/RPMS/Fedora/rabbitmq-server.init
deleted file mode 100644
index 15929108b5..0000000000
--- a/packaging/RPMS/Fedora/rabbitmq-server.init
+++ /dev/null
@@ -1,184 +0,0 @@
-#!/bin/sh
-#
-# rabbitmq-server RabbitMQ broker
-#
-# chkconfig: - 80 05
-# description: Enable AMQP service provided by RabbitMQ
-#
-
-### BEGIN INIT INFO
-# Provides: rabbitmq-server
-# Required-Start: $remote_fs $network
-# Required-Stop: $remote_fs $network
-# Default-Start: 3 5
-# Default-Stop: 0 1 2 6
-# Description: RabbitMQ broker
-# Short-Description: Enable AMQP service provided by RabbitMQ broker
-### END INIT INFO
-
-@FUNCTION_LIBRARY@
-
-PATH=/sbin:/usr/sbin:/bin:/usr/bin
-NAME=rabbitmq-server
-DAEMON=/usr/sbin/${NAME}
-CONTROL=/usr/sbin/rabbitmqctl
-DESC=rabbitmq-server
-USER=rabbitmq
-ROTATE_SUFFIX=
-PID_FILE=/var/run/rabbitmq/pid
-RABBITMQ_ENV=/usr/lib/rabbitmq/bin/rabbitmq-env
-
-START_PROG= # Set when building package
-LOCK_FILE=/var/lock/subsys/$NAME
-
-test -x $DAEMON || exit 0
-test -x $CONTROL || exit 0
-
-RETVAL=0
-set -e
-
-[ -f /etc/default/${NAME} ] && . /etc/default/${NAME}
-
-RABBITMQ_SCRIPTS_DIR=$(dirname "$RABBITMQ_ENV")
-. "$RABBITMQ_ENV"
-
-ensure_pid_dir () {
- PID_DIR=`dirname ${PID_FILE}`
- if [ ! -d ${PID_DIR} ] ; then
- mkdir -p ${PID_DIR}
- chown -R ${USER}:${USER} ${PID_DIR}
- chmod 755 ${PID_DIR}
- fi
-}
-
-remove_pid () {
- rm -f ${PID_FILE}
- rmdir `dirname ${PID_FILE}` || :
-}
-
-start_rabbitmq () {
- status_rabbitmq quiet
- if [ $RETVAL = 0 ] ; then
- echo RabbitMQ is currently running
- else
- RETVAL=0
- ensure_pid_dir
- set +e
- RABBITMQ_PID_FILE=$PID_FILE $START_PROG $DAEMON \
- > "${RABBITMQ_LOG_BASE}/startup_log" \
- 2> "${RABBITMQ_LOG_BASE}/startup_err" \
- 0<&- &
- $CONTROL wait $PID_FILE >/dev/null 2>&1
- RETVAL=$?
- set -e
- case "$RETVAL" in
- 0)
- echo SUCCESS
- if [ -n "$LOCK_FILE" ] ; then
- touch $LOCK_FILE
- fi
- ;;
- *)
- remove_pid
- echo FAILED - check ${RABBITMQ_LOG_BASE}/startup_\{log, _err\}
- RETVAL=1
- ;;
- esac
- fi
-}
-
-stop_rabbitmq () {
- status_rabbitmq quiet
- if [ $RETVAL = 0 ] ; then
- set +e
- $CONTROL stop ${PID_FILE} \
- > ${RABBITMQ_LOG_BASE}/shutdown_log \
- 2> ${RABBITMQ_LOG_BASE}/shutdown_err
- RETVAL=$?
- set -e
- if [ $RETVAL = 0 ] ; then
- remove_pid
- if [ -n "$LOCK_FILE" ] ; then
- rm -f $LOCK_FILE
- fi
- else
- echo FAILED - check ${RABBITMQ_LOG_BASE}/shutdown_log, _err
- fi
- else
- echo RabbitMQ is not running
- RETVAL=0
- fi
-}
-
-status_rabbitmq() {
- set +e
- if [ "$1" != "quiet" ] ; then
- $CONTROL status 2>&1
- else
- $CONTROL status > /dev/null 2>&1
- fi
- if [ $? != 0 ] ; then
- RETVAL=3
- fi
- set -e
-}
-
-rotate_logs_rabbitmq() {
- set +e
- $CONTROL rotate_logs ${ROTATE_SUFFIX}
- if [ $? != 0 ] ; then
- RETVAL=1
- fi
- set -e
-}
-
-restart_running_rabbitmq () {
- status_rabbitmq quiet
- if [ $RETVAL = 0 ] ; then
- restart_rabbitmq
- else
- echo RabbitMQ is not runnning
- RETVAL=0
- fi
-}
-
-restart_rabbitmq() {
- stop_rabbitmq
- start_rabbitmq
-}
-
-case "$1" in
- start)
- echo -n "Starting $DESC: "
- start_rabbitmq
- echo "$NAME."
- ;;
- stop)
- echo -n "Stopping $DESC: "
- stop_rabbitmq
- echo "$NAME."
- ;;
- status)
- status_rabbitmq
- ;;
- rotate-logs)
- echo -n "Rotating log files for $DESC: "
- rotate_logs_rabbitmq
- ;;
- force-reload|reload|restart)
- echo -n "Restarting $DESC: "
- restart_rabbitmq
- echo "$NAME."
- ;;
- try-restart)
- echo -n "Restarting $DESC: "
- restart_running_rabbitmq
- echo "$NAME."
- ;;
- *)
- echo "Usage: $0 {start|stop|status|rotate-logs|restart|condrestart|try-restart|reload|force-reload}" >&2
- RETVAL=1
- ;;
-esac
-
-exit $RETVAL
diff --git a/packaging/RPMS/Fedora/rabbitmq-server.logrotate b/packaging/RPMS/Fedora/rabbitmq-server.logrotate
deleted file mode 100644
index f902ed185f..0000000000
--- a/packaging/RPMS/Fedora/rabbitmq-server.logrotate
+++ /dev/null
@@ -1,12 +0,0 @@
-/var/log/rabbitmq/*.log {
- weekly
- missingok
- rotate 20
- compress
- delaycompress
- notifempty
- sharedscripts
- postrotate
- /usr/sbin/rabbitmqctl rotate_logs > /dev/null
- endscript
-}
diff --git a/packaging/RPMS/Fedora/rabbitmq-server.service b/packaging/RPMS/Fedora/rabbitmq-server.service
deleted file mode 100644
index 7fe15fe36c..0000000000
--- a/packaging/RPMS/Fedora/rabbitmq-server.service
+++ /dev/null
@@ -1,16 +0,0 @@
-[Unit]
-Description=RabbitMQ broker
-After=syslog.target network.target
-
-[Service]
-Type=notify
-User=rabbitmq
-Group=rabbitmq
-WorkingDirectory=/var/lib/rabbitmq
-ExecStart=/usr/sbin/rabbitmq-server
-ExecStop=/usr/sbin/rabbitmqctl stop
-NotifyAccess=all
-TimeoutStartSec=3600
-
-[Install]
-WantedBy=multi-user.target
diff --git a/packaging/RPMS/Fedora/rabbitmq-server.spec b/packaging/RPMS/Fedora/rabbitmq-server.spec
deleted file mode 100644
index 9ad05e59fb..0000000000
--- a/packaging/RPMS/Fedora/rabbitmq-server.spec
+++ /dev/null
@@ -1,415 +0,0 @@
-%define debug_package %{nil}
-%define erlang_minver R16B-03
-
-Name: rabbitmq-server
-Version: %%VERSION%%
-Release: 1%{?dist}
-License: MPLv1.1 and MIT and ASL 2.0 and BSD
-Group: %{group_tag}
-Source: http://www.rabbitmq.com/releases/rabbitmq-server/v%{version}/%{name}-%{version}.tar.xz
-Source1: rabbitmq-server.init
-Source2: rabbitmq-server.logrotate
-Source3: rabbitmq-server.service
-Source4: rabbitmq-server.tmpfiles
-URL: http://www.rabbitmq.com/
-BuildArch: noarch
-BuildRequires: erlang >= %{erlang_minver}, python-simplejson, xmlto, libxslt, gzip, sed, zip, rsync
-
-%if 0%{?fedora} || 0%{?rhel} >= 7
-BuildRequires: systemd
-%endif
-
-Requires: erlang >= %{erlang_minver}, logrotate, socat
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%{_arch}-root
-Summary: The RabbitMQ server
-
-%if 0%{?fedora} || 0%{?rhel} >= 7
-Requires(pre): systemd
-Requires(post): systemd
-Requires(preun): systemd
-%else
-Requires(post): %%REQUIRES%%
-Requires(pre): %%REQUIRES%%
-%endif
-
-%description
-RabbitMQ is an open source multi-protocol messaging broker.
-
-# We want to install into /usr/lib, even on 64-bit platforms
-%define _rabbit_libdir %{_exec_prefix}/lib/rabbitmq
-%define _rabbit_erllibdir %{_rabbit_libdir}/lib/rabbitmq_server-%{version}
-%define _rabbit_server_ocf scripts/rabbitmq-server.ocf
-%define _plugins_state_dir %{_localstatedir}/lib/rabbitmq/plugins
-%define _rabbit_server_ha_ocf scripts/rabbitmq-server-ha.ocf
-
-
-%define _maindir %{buildroot}%{_rabbit_erllibdir}
-
-
-%prep
-%setup -q
-
-%build
-cp -a docs/README-for-packages %{_builddir}/rabbitmq-server-%{version}/README
-make %{?_smp_mflags} dist manpages
-
-%install
-rm -rf %{buildroot}
-
-make install install-bin install-man DESTDIR=%{buildroot} PREFIX=%{_exec_prefix} RMQ_ROOTDIR=%{_rabbit_libdir} MANDIR=%{_mandir}
-
-mkdir -p %{buildroot}%{_localstatedir}/lib/rabbitmq/mnesia
-mkdir -p %{buildroot}%{_localstatedir}/log/rabbitmq
-
-#Copy all necessary lib files etc.
-
-%if 0%{?fedora} || 0%{?rhel} >= 7
-install -p -D -m 0644 %{S:3} %{buildroot}%{_unitdir}/%{name}.service
-%else
-install -p -D -m 0755 %{S:1} %{buildroot}%{_initrddir}/rabbitmq-server
-%endif
-
-install -p -D -m 0755 %{_rabbit_server_ocf} %{buildroot}%{_exec_prefix}/lib/ocf/resource.d/rabbitmq/rabbitmq-server
-install -p -D -m 0755 %{_rabbit_server_ha_ocf} %{buildroot}%{_exec_prefix}/lib/ocf/resource.d/rabbitmq/rabbitmq-server-ha
-install -p -D -m 0644 %{S:2} %{buildroot}%{_sysconfdir}/logrotate.d/rabbitmq-server
-
-mkdir -p %{buildroot}%{_sysconfdir}/rabbitmq
-
-mkdir -p %{buildroot}%{_sbindir}
-sed -e 's|@SU_RABBITMQ_SH_C@|su rabbitmq -s /bin/sh -c|' \
- -e 's|@STDOUT_STDERR_REDIRECTION@||' \
- < scripts/rabbitmq-script-wrapper \
- > %{buildroot}%{_sbindir}/rabbitmqctl
-chmod 0755 %{buildroot}%{_sbindir}/rabbitmqctl
-for script in rabbitmq-server rabbitmq-plugins; do \
- cp -a %{buildroot}%{_sbindir}/rabbitmqctl \
- %{buildroot}%{_sbindir}/$script; \
-done
-
-%if 0%{?fedora} > 14 || 0%{?rhel} >= 7
-install -D -p -m 0644 %{SOURCE4} %{buildroot}%{_prefix}/lib/tmpfiles.d/%{name}.conf
-%endif
-
-rm %{_maindir}/LICENSE* %{_maindir}/INSTALL
-
-#Build the list of files
-echo '%defattr(-,root,root, -)' >%{_builddir}/%{name}.files
-find %{buildroot} -path %{buildroot}%{_sysconfdir} -prune -o '!' -type d -printf "/%%P\n" >>%{_builddir}/%{name}.files
-
-%pre
-
-if [ $1 -gt 1 ]; then
- # Upgrade - stop previous instance of rabbitmq-server init.d (this
- # will also activate systemd if it was used) script.
- /sbin/service rabbitmq-server stop
-fi
-
-# create rabbitmq group
-if ! getent group rabbitmq >/dev/null; then
- groupadd -r rabbitmq
-fi
-
-# create rabbitmq user
-if ! getent passwd rabbitmq >/dev/null; then
- useradd -r -g rabbitmq -d %{_localstatedir}/lib/rabbitmq rabbitmq \
- -c "RabbitMQ messaging server"
-fi
-
-%post
-
-%if 0%{?fedora} || 0%{?rhel} >= 7
-# %%systemd_post %%{name}.service
-# manual expansion of systemd_post as this doesn't appear to
-# expand correctly on debian machines
-if [ $1 -eq 1 ] ; then
- # Initial installation
- systemctl preset %{name}.service >/dev/null 2>&1 || :
-fi
-/bin/systemctl daemon-reload
-%else
-/sbin/chkconfig --add %{name}
-%endif
-if [ -f %{_sysconfdir}/rabbitmq/rabbitmq.conf ] && [ ! -f %{_sysconfdir}/rabbitmq/rabbitmq-env.conf ]; then
- mv %{_sysconfdir}/rabbitmq/rabbitmq.conf %{_sysconfdir}/rabbitmq/rabbitmq-env.conf
-fi
-chmod -R o-rwx,g-w %{_localstatedir}/lib/rabbitmq/mnesia
-
-%preun
-if [ $1 = 0 ]; then
- #Complete uninstall
-%if 0%{?fedora} || 0%{?rhel} >= 7
- systemctl stop rabbitmq-server
-%else
- /sbin/service rabbitmq-server stop
- /sbin/chkconfig --del rabbitmq-server
-%endif
-
- # We do not remove /var/log and /var/lib directories
- # Leave rabbitmq user and group
-fi
-
-# Clean out plugin activation state, both on uninstall and upgrade
-rm -rf %{_plugins_state_dir}
-for ext in rel script boot ; do
- rm -f %{_rabbit_erllibdir}/ebin/rabbit.$ext
-done
-
-%postun
-%if 0%{?fedora} || 0%{?rhel} >= 7
-# %%systemd_postun_with_restart %%{name}.service
-# manual expansion of systemd_postun_with_restart as this doesn't appear to
-# expand correctly on debian machines
-if [ $1 -ge 1 ] ; then
- # Package upgrade, not uninstall
- systemctl try-restart %{name}.service >/dev/null 2>&1 || :
-fi
-%else
-if [ $1 -gt 1 ]; then
- /sbin/service %{name} try-restart
-fi
-%endif
-
-%if 0%{?fedora} > 17 || 0%{?rhel} >= 7
-# For prior versions older than this, do a conversion
-# from sysv to systemd
-%triggerun -- %{name} < 3.6.5
-# Save the current service runlevel info
-# User must manually run systemd-sysv-convert --apply opensips
-# to migrate them to systemd targets
-/usr/bin/systemd-sysv-convert --save %{name} >/dev/null 2>&1 ||:
-
-# Run these because the SysV package being removed won't do them
-/sbin/chkconfig --del %{name} >/dev/null 2>&1 || :
-/bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
-%endif
-
-%files -f ../%{name}.files
-%defattr(-,root,root,-)
-%attr(0755, rabbitmq, rabbitmq) %dir %{_localstatedir}/lib/rabbitmq
-%attr(0750, rabbitmq, rabbitmq) %dir %{_localstatedir}/lib/rabbitmq/mnesia
-%attr(0755, rabbitmq, rabbitmq) %dir %{_localstatedir}/log/rabbitmq
-%dir %{_sysconfdir}/rabbitmq
-
-%if 0%{?rhel} < 7
-%{_initrddir}/rabbitmq-server
-%endif
-
-%config(noreplace) %{_sysconfdir}/logrotate.d/rabbitmq-server
-%doc LICENSE*
-%doc README
-%doc docs/rabbitmq.config.example
-%doc docs/set_rabbitmq_policy.sh.example
-
-%clean
-rm -rf %{buildroot}
-
-%changelog
-* Fri Aug 5 2016 michael@rabbitmq.com 3.6.5-1
-- New Upstream Release
-
-* Fri Jul 29 2016 michael@rabbitmq.com 3.6.4-1
-- New Upstream Release
-
-* Wed Jul 6 2016 michael@rabbitmq.com 3.6.3-1
-- New Upstream Release
-
-* Thu May 19 2016 michael@rabbitmq.com 3.6.2-1
-- New Upstream Release
-
-* Tue Mar 1 2016 michael@rabbitmq.com 3.6.1-1
-- New Upstream Release
-
-* Tue Dec 22 2015 michael@rabbitmq.com 3.6.0-1
-- New Upstream Release
-
-* Tue Dec 15 2015 michael@rabbitmq.com 3.5.7-1
-- New Upstream Release
-
-* Wed Oct 7 2015 michael@rabbitmq.com 3.5.6-1
-- New Upstream Release
-
-* Thu Sep 24 2015 jean-sebastien@rabbitmq.com 3.5.5-3
-- Fix bashism in rabbitmq-script-wrapper
-
-* Thu Sep 24 2015 jean-sebastien@rabbitmq.com 3.5.5-1
-- New Upstream Release
-
-* Tue Jul 21 2015 michael@rabbitmq.com 3.5.4-1
-- New Upstream Release
-
-* Fri May 22 2015 jean-sebastien@rabbitmq.com 3.5.3-1
-- New Upstream Release
-
-* Tue May 12 2015 jean-sebastien@rabbitmq.com 3.5.2-1
-- New Upstream Release
-
-* Thu Apr 2 2015 michael@rabbitmq.com 3.5.1-1
-- New Upstream Release
-
-* Wed Mar 11 2015 jean-sebastien@rabbitmq.com 3.5.0-1
-- New Upstream Release
-
-* Wed Feb 11 2015 michael@rabbitmq.com 3.4.4-1
-- New Upstream Release
-
-* Tue Jan 6 2015 jean-sebastien@rabbitmq.com 3.4.3-1
-- New Upstream Release
-
-* Wed Nov 26 2014 simon@rabbitmq.com 3.4.2-1
-- New Upstream Release
-
-* Wed Oct 29 2014 simon@rabbitmq.com 3.4.1-1
-- New Upstream Release
-
-* Tue Oct 21 2014 simon@rabbitmq.com 3.4.0-1
-- New Upstream Release
-
-* Mon Aug 11 2014 simon@rabbitmq.com 3.3.5-1
-- New Upstream Release
-
-* Tue Jun 24 2014 simon@rabbitmq.com 3.3.4-1
-- New Upstream Release
-
-* Mon Jun 16 2014 simon@rabbitmq.com 3.3.3-1
-- New Upstream Release
-
-* Mon Jun 9 2014 simon@rabbitmq.com 3.3.2-1
-- New Upstream Release
-
-* Tue Apr 29 2014 simon@rabbitmq.com 3.3.1-1
-- New Upstream Release
-
-* Wed Apr 2 2014 simon@rabbitmq.com 3.3.0-1
-- New Upstream Release
-
-* Mon Mar 3 2014 simon@rabbitmq.com 3.2.4-1
-- New Upstream Release
-
-* Thu Jan 23 2014 emile@rabbitmq.com 3.2.3-1
-- New Upstream Release
-
-* Tue Dec 10 2013 emile@rabbitmq.com 3.2.2-1
-- New Upstream Release
-
-* Wed Oct 23 2013 emile@rabbitmq.com 3.2.0-1
-- New Upstream Release
-
-* Thu Aug 15 2013 simon@rabbitmq.com 3.1.5-1
-- New Upstream Release
-
-* Tue Jun 25 2013 tim@rabbitmq.com 3.1.3-1
-- New Upstream Release
-
-* Mon Jun 24 2013 tim@rabbitmq.com 3.1.2-1
-- New Upstream Release
-
-* Mon May 20 2013 tim@rabbitmq.com 3.1.1-1
-- Test release
-
-* Wed May 1 2013 simon@rabbitmq.com 3.1.0-1
-- New Upstream Release
-
-* Tue Dec 11 2012 simon@rabbitmq.com 3.0.1-1
-- New Upstream Release
-
-* Fri Nov 16 2012 simon@rabbitmq.com 3.0.0-1
-- New Upstream Release
-
-* Fri Dec 16 2011 steve@rabbitmq.com 2.7.1-1
-- New Upstream Release
-
-* Tue Nov 8 2011 steve@rabbitmq.com 2.7.0-1
-- New Upstream Release
-
-* Fri Sep 9 2011 tim@rabbitmq.com 2.6.1-1
-- New Upstream Release
-
-* Fri Aug 26 2011 tim@rabbitmq.com 2.6.0-1
-- New Upstream Release
-
-* Mon Jun 27 2011 simon@rabbitmq.com 2.5.1-1
-- New Upstream Release
-
-* Thu Jun 9 2011 jerryk@vmware.com 2.5.0-1
-- New Upstream Release
-
-* Thu Apr 7 2011 Alexandru Scvortov <alexandru@rabbitmq.com> 2.4.1-1
-- New Upstream Release
-
-* Tue Mar 22 2011 Alexandru Scvortov <alexandru@rabbitmq.com> 2.4.0-1
-- New Upstream Release
-
-* Thu Feb 3 2011 simon@rabbitmq.com 2.3.1-1
-- New Upstream Release
-
-* Tue Feb 1 2011 simon@rabbitmq.com 2.3.0-1
-- New Upstream Release
-
-* Mon Nov 29 2010 rob@rabbitmq.com 2.2.0-1
-- New Upstream Release
-
-* Tue Oct 19 2010 vlad@rabbitmq.com 2.1.1-1
-- New Upstream Release
-
-* Tue Sep 14 2010 marek@rabbitmq.com 2.1.0-1
-- New Upstream Release
-
-* Mon Aug 23 2010 mikeb@rabbitmq.com 2.0.0-1
-- New Upstream Release
-
-* Wed Jul 14 2010 Emile Joubert <emile@rabbitmq.com> 1.8.1-1
-- New Upstream Release
-
-* Tue Jun 15 2010 Matthew Sackman <matthew@rabbitmq.com> 1.8.0-1
-- New Upstream Release
-
-* Mon Feb 15 2010 Matthew Sackman <matthew@lshift.net> 1.7.2-1
-- New Upstream Release
-
-* Fri Jan 22 2010 Matthew Sackman <matthew@lshift.net> 1.7.1-1
-- New Upstream Release
-
-* Mon Oct 5 2009 David Wragg <dpw@lshift.net> 1.7.0-1
-- New upstream release
-
-* Wed Jun 17 2009 Matthias Radestock <matthias@lshift.net> 1.6.0-1
-- New upstream release
-
-* Tue May 19 2009 Matthias Radestock <matthias@lshift.net> 1.5.5-1
-- Maintenance release for the 1.5.x series
-
-* Mon Apr 6 2009 Matthias Radestock <matthias@lshift.net> 1.5.4-1
-- Maintenance release for the 1.5.x series
-
-* Tue Feb 24 2009 Tony Garnock-Jones <tonyg@lshift.net> 1.5.3-1
-- Maintenance release for the 1.5.x series
-
-* Mon Feb 23 2009 Tony Garnock-Jones <tonyg@lshift.net> 1.5.2-1
-- Maintenance release for the 1.5.x series
-
-* Mon Jan 19 2009 Ben Hood <0x6e6562@gmail.com> 1.5.1-1
-- Maintenance release for the 1.5.x series
-
-* Wed Dec 17 2008 Matthias Radestock <matthias@lshift.net> 1.5.0-1
-- New upstream release
-
-* Thu Jul 24 2008 Tony Garnock-Jones <tonyg@lshift.net> 1.4.0-1
-- New upstream release
-
-* Mon Mar 3 2008 Adrien Pierard <adrian@lshift.net> 1.3.0-1
-- New upstream release
-
-* Wed Sep 26 2007 Simon MacMullen <simon@lshift.net> 1.2.0-1
-- New upstream release
-
-* Wed Aug 29 2007 Simon MacMullen <simon@lshift.net> 1.1.1-1
-- New upstream release
-
-* Mon Jul 30 2007 Simon MacMullen <simon@lshift.net> 1.1.0-1.alpha
-- New upstream release
-
-* Tue Jun 12 2007 Hubert Plociniczak <hubert@lshift.net> 1.0.0-1.20070607
-- Building from source tarball, added starting script, stopping
-
-* Mon May 21 2007 Hubert Plociniczak <hubert@lshift.net> 1.0.0-1.alpha
-- Initial build of server library of RabbitMQ package
diff --git a/packaging/RPMS/Fedora/rabbitmq-server.tmpfiles b/packaging/RPMS/Fedora/rabbitmq-server.tmpfiles
deleted file mode 100644
index c2681827e0..0000000000
--- a/packaging/RPMS/Fedora/rabbitmq-server.tmpfiles
+++ /dev/null
@@ -1 +0,0 @@
-D /var/run/rabbitmq 0755 rabbitmq rabbitmq -
diff --git a/packaging/common/LICENSE.head b/packaging/common/LICENSE.head
deleted file mode 100644
index 2b5a17ee46..0000000000
--- a/packaging/common/LICENSE.head
+++ /dev/null
@@ -1,5 +0,0 @@
-This package, the RabbitMQ server is licensed under the MPL.
-
-If you have any questions regarding licensing, please contact us at
-info@rabbitmq.com.
-
diff --git a/packaging/common/LICENSE.tail b/packaging/common/LICENSE.tail
deleted file mode 100644
index 73c8e987fb..0000000000
--- a/packaging/common/LICENSE.tail
+++ /dev/null
@@ -1,516 +0,0 @@
-
-The MIT license is as follows:
-
- "Permission is hereby granted, free of charge, to any person
- obtaining a copy of this file (the Software), to deal in the
- Software without restriction, including without limitation the
- rights to use, copy, modify, merge, publish, distribute,
- sublicense, and/or sell copies of the Software, and to permit
- persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE."
-
-
-The BSD 2-Clause license is as follows:
-
- "Redistribution and use in source and binary forms, with or
- without modification, are permitted provided that the
- following conditions are met:
-
- 1. Redistributions of source code must retain the above
- copyright notice, this list of conditions and the following
- disclaimer.
-
- 2. Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials
- provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-
-
-The rest of this package is licensed under the Mozilla Public License 1.1
-Authors and Copyright are as described below:
-
- The Initial Developer of the Original Code is GoPivotal, Inc.
- Copyright (c) 2007-2015 Pivotal Software, Inc. All rights reserved.
-
-
- MOZILLA PUBLIC LICENSE
- Version 1.1
-
- ---------------
-
-1. Definitions.
-
- 1.0.1. "Commercial Use" means distribution or otherwise making the
- Covered Code available to a third party.
-
- 1.1. "Contributor" means each entity that creates or contributes to
- the creation of Modifications.
-
- 1.2. "Contributor Version" means the combination of the Original
- Code, prior Modifications used by a Contributor, and the Modifications
- made by that particular Contributor.
-
- 1.3. "Covered Code" means the Original Code or Modifications or the
- combination of the Original Code and Modifications, in each case
- including portions thereof.
-
- 1.4. "Electronic Distribution Mechanism" means a mechanism generally
- accepted in the software development community for the electronic
- transfer of data.
-
- 1.5. "Executable" means Covered Code in any form other than Source
- Code.
-
- 1.6. "Initial Developer" means the individual or entity identified
- as the Initial Developer in the Source Code notice required by Exhibit
- A.
-
- 1.7. "Larger Work" means a work which combines Covered Code or
- portions thereof with code not governed by the terms of this License.
-
- 1.8. "License" means this document.
-
- 1.8.1. "Licensable" means having the right to grant, to the maximum
- extent possible, whether at the time of the initial grant or
- subsequently acquired, any and all of the rights conveyed herein.
-
- 1.9. "Modifications" means any addition to or deletion from the
- substance or structure of either the Original Code or any previous
- Modifications. When Covered Code is released as a series of files, a
- Modification is:
- A. Any addition to or deletion from the contents of a file
- containing Original Code or previous Modifications.
-
- B. Any new file that contains any part of the Original Code or
- previous Modifications.
-
- 1.10. "Original Code" means Source Code of computer software code
- which is described in the Source Code notice required by Exhibit A as
- Original Code, and which, at the time of its release under this
- License is not already Covered Code governed by this License.
-
- 1.10.1. "Patent Claims" means any patent claim(s), now owned or
- hereafter acquired, including without limitation, method, process,
- and apparatus claims, in any patent Licensable by grantor.
-
- 1.11. "Source Code" means the preferred form of the Covered Code for
- making modifications to it, including all modules it contains, plus
- any associated interface definition files, scripts used to control
- compilation and installation of an Executable, or source code
- differential comparisons against either the Original Code or another
- well known, available Covered Code of the Contributor's choice. The
- Source Code can be in a compressed or archival form, provided the
- appropriate decompression or de-archiving software is widely available
- for no charge.
-
- 1.12. "You" (or "Your") means an individual or a legal entity
- exercising rights under, and complying with all of the terms of, this
- License or a future version of this License issued under Section 6.1.
- For legal entities, "You" includes any entity which controls, is
- controlled by, or is under common control with You. For purposes of
- this definition, "control" means (a) the power, direct or indirect,
- to cause the direction or management of such entity, whether by
- contract or otherwise, or (b) ownership of more than fifty percent
- (50%) of the outstanding shares or beneficial ownership of such
- entity.
-
-2. Source Code License.
-
- 2.1. The Initial Developer Grant.
- The Initial Developer hereby grants You a world-wide, royalty-free,
- non-exclusive license, subject to third party intellectual property
- claims:
- (a) under intellectual property rights (other than patent or
- trademark) Licensable by Initial Developer to use, reproduce,
- modify, display, perform, sublicense and distribute the Original
- Code (or portions thereof) with or without Modifications, and/or
- as part of a Larger Work; and
-
- (b) under Patents Claims infringed by the making, using or
- selling of Original Code, to make, have made, use, practice,
- sell, and offer for sale, and/or otherwise dispose of the
- Original Code (or portions thereof).
-
- (c) the licenses granted in this Section 2.1(a) and (b) are
- effective on the date Initial Developer first distributes
- Original Code under the terms of this License.
-
- (d) Notwithstanding Section 2.1(b) above, no patent license is
- granted: 1) for code that You delete from the Original Code; 2)
- separate from the Original Code; or 3) for infringements caused
- by: i) the modification of the Original Code or ii) the
- combination of the Original Code with other software or devices.
-
- 2.2. Contributor Grant.
- Subject to third party intellectual property claims, each Contributor
- hereby grants You a world-wide, royalty-free, non-exclusive license
-
- (a) under intellectual property rights (other than patent or
- trademark) Licensable by Contributor, to use, reproduce, modify,
- display, perform, sublicense and distribute the Modifications
- created by such Contributor (or portions thereof) either on an
- unmodified basis, with other Modifications, as Covered Code
- and/or as part of a Larger Work; and
-
- (b) under Patent Claims infringed by the making, using, or
- selling of Modifications made by that Contributor either alone
- and/or in combination with its Contributor Version (or portions
- of such combination), to make, use, sell, offer for sale, have
- made, and/or otherwise dispose of: 1) Modifications made by that
- Contributor (or portions thereof); and 2) the combination of
- Modifications made by that Contributor with its Contributor
- Version (or portions of such combination).
-
- (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
- effective on the date Contributor first makes Commercial Use of
- the Covered Code.
-
- (d) Notwithstanding Section 2.2(b) above, no patent license is
- granted: 1) for any code that Contributor has deleted from the
- Contributor Version; 2) separate from the Contributor Version;
- 3) for infringements caused by: i) third party modifications of
- Contributor Version or ii) the combination of Modifications made
- by that Contributor with other software (except as part of the
- Contributor Version) or other devices; or 4) under Patent Claims
- infringed by Covered Code in the absence of Modifications made by
- that Contributor.
-
-3. Distribution Obligations.
-
- 3.1. Application of License.
- The Modifications which You create or to which You contribute are
- governed by the terms of this License, including without limitation
- Section 2.2. The Source Code version of Covered Code may be
- distributed only under the terms of this License or a future version
- of this License released under Section 6.1, and You must include a
- copy of this License with every copy of the Source Code You
- distribute. You may not offer or impose any terms on any Source Code
- version that alters or restricts the applicable version of this
- License or the recipients' rights hereunder. However, You may include
- an additional document offering the additional rights described in
- Section 3.5.
-
- 3.2. Availability of Source Code.
- Any Modification which You create or to which You contribute must be
- made available in Source Code form under the terms of this License
- either on the same media as an Executable version or via an accepted
- Electronic Distribution Mechanism to anyone to whom you made an
- Executable version available; and if made available via Electronic
- Distribution Mechanism, must remain available for at least twelve (12)
- months after the date it initially became available, or at least six
- (6) months after a subsequent version of that particular Modification
- has been made available to such recipients. You are responsible for
- ensuring that the Source Code version remains available even if the
- Electronic Distribution Mechanism is maintained by a third party.
-
- 3.3. Description of Modifications.
- You must cause all Covered Code to which You contribute to contain a
- file documenting the changes You made to create that Covered Code and
- the date of any change. You must include a prominent statement that
- the Modification is derived, directly or indirectly, from Original
- Code provided by the Initial Developer and including the name of the
- Initial Developer in (a) the Source Code, and (b) in any notice in an
- Executable version or related documentation in which You describe the
- origin or ownership of the Covered Code.
-
- 3.4. Intellectual Property Matters
- (a) Third Party Claims.
- If Contributor has knowledge that a license under a third party's
- intellectual property rights is required to exercise the rights
- granted by such Contributor under Sections 2.1 or 2.2,
- Contributor must include a text file with the Source Code
- distribution titled "LEGAL" which describes the claim and the
- party making the claim in sufficient detail that a recipient will
- know whom to contact. If Contributor obtains such knowledge after
- the Modification is made available as described in Section 3.2,
- Contributor shall promptly modify the LEGAL file in all copies
- Contributor makes available thereafter and shall take other steps
- (such as notifying appropriate mailing lists or newsgroups)
- reasonably calculated to inform those who received the Covered
- Code that new knowledge has been obtained.
-
- (b) Contributor APIs.
- If Contributor's Modifications include an application programming
- interface and Contributor has knowledge of patent licenses which
- are reasonably necessary to implement that API, Contributor must
- also include this information in the LEGAL file.
-
- (c) Representations.
- Contributor represents that, except as disclosed pursuant to
- Section 3.4(a) above, Contributor believes that Contributor's
- Modifications are Contributor's original creation(s) and/or
- Contributor has sufficient rights to grant the rights conveyed by
- this License.
-
- 3.5. Required Notices.
- You must duplicate the notice in Exhibit A in each file of the Source
- Code. If it is not possible to put such notice in a particular Source
- Code file due to its structure, then You must include such notice in a
- location (such as a relevant directory) where a user would be likely
- to look for such a notice. If You created one or more Modification(s)
- You may add your name as a Contributor to the notice described in
- Exhibit A. You must also duplicate this License in any documentation
- for the Source Code where You describe recipients' rights or ownership
- rights relating to Covered Code. You may choose to offer, and to
- charge a fee for, warranty, support, indemnity or liability
- obligations to one or more recipients of Covered Code. However, You
- may do so only on Your own behalf, and not on behalf of the Initial
- Developer or any Contributor. You must make it absolutely clear than
- any such warranty, support, indemnity or liability obligation is
- offered by You alone, and You hereby agree to indemnify the Initial
- Developer and every Contributor for any liability incurred by the
- Initial Developer or such Contributor as a result of warranty,
- support, indemnity or liability terms You offer.
-
- 3.6. Distribution of Executable Versions.
- You may distribute Covered Code in Executable form only if the
- requirements of Section 3.1-3.5 have been met for that Covered Code,
- and if You include a notice stating that the Source Code version of
- the Covered Code is available under the terms of this License,
- including a description of how and where You have fulfilled the
- obligations of Section 3.2. The notice must be conspicuously included
- in any notice in an Executable version, related documentation or
- collateral in which You describe recipients' rights relating to the
- Covered Code. You may distribute the Executable version of Covered
- Code or ownership rights under a license of Your choice, which may
- contain terms different from this License, provided that You are in
- compliance with the terms of this License and that the license for the
- Executable version does not attempt to limit or alter the recipient's
- rights in the Source Code version from the rights set forth in this
- License. If You distribute the Executable version under a different
- license You must make it absolutely clear that any terms which differ
- from this License are offered by You alone, not by the Initial
- Developer or any Contributor. You hereby agree to indemnify the
- Initial Developer and every Contributor for any liability incurred by
- the Initial Developer or such Contributor as a result of any such
- terms You offer.
-
- 3.7. Larger Works.
- You may create a Larger Work by combining Covered Code with other code
- not governed by the terms of this License and distribute the Larger
- Work as a single product. In such a case, You must make sure the
- requirements of this License are fulfilled for the Covered Code.
-
-4. Inability to Comply Due to Statute or Regulation.
-
- If it is impossible for You to comply with any of the terms of this
- License with respect to some or all of the Covered Code due to
- statute, judicial order, or regulation then You must: (a) comply with
- the terms of this License to the maximum extent possible; and (b)
- describe the limitations and the code they affect. Such description
- must be included in the LEGAL file described in Section 3.4 and must
- be included with all distributions of the Source Code. Except to the
- extent prohibited by statute or regulation, such description must be
- sufficiently detailed for a recipient of ordinary skill to be able to
- understand it.
-
-5. Application of this License.
-
- This License applies to code to which the Initial Developer has
- attached the notice in Exhibit A and to related Covered Code.
-
-6. Versions of the License.
-
- 6.1. New Versions.
- Netscape Communications Corporation ("Netscape") may publish revised
- and/or new versions of the License from time to time. Each version
- will be given a distinguishing version number.
-
- 6.2. Effect of New Versions.
- Once Covered Code has been published under a particular version of the
- License, You may always continue to use it under the terms of that
- version. You may also choose to use such Covered Code under the terms
- of any subsequent version of the License published by Netscape. No one
- other than Netscape has the right to modify the terms applicable to
- Covered Code created under this License.
-
- 6.3. Derivative Works.
- If You create or use a modified version of this License (which you may
- only do in order to apply it to code which is not already Covered Code
- governed by this License), You must (a) rename Your license so that
- the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
- "MPL", "NPL" or any confusingly similar phrase do not appear in your
- license (except to note that your license differs from this License)
- and (b) otherwise make it clear that Your version of the license
- contains terms which differ from the Mozilla Public License and
- Netscape Public License. (Filling in the name of the Initial
- Developer, Original Code or Contributor in the notice described in
- Exhibit A shall not of themselves be deemed to be modifications of
- this License.)
-
-7. DISCLAIMER OF WARRANTY.
-
- COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
- DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
- THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
- IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
- YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
- COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
- OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
- ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
-
-8. TERMINATION.
-
- 8.1. This License and the rights granted hereunder will terminate
- automatically if You fail to comply with terms herein and fail to cure
- such breach within 30 days of becoming aware of the breach. All
- sublicenses to the Covered Code which are properly granted shall
- survive any termination of this License. Provisions which, by their
- nature, must remain in effect beyond the termination of this License
- shall survive.
-
- 8.2. If You initiate litigation by asserting a patent infringement
- claim (excluding declatory judgment actions) against Initial Developer
- or a Contributor (the Initial Developer or Contributor against whom
- You file such action is referred to as "Participant") alleging that:
-
- (a) such Participant's Contributor Version directly or indirectly
- infringes any patent, then any and all rights granted by such
- Participant to You under Sections 2.1 and/or 2.2 of this License
- shall, upon 60 days notice from Participant terminate prospectively,
- unless if within 60 days after receipt of notice You either: (i)
- agree in writing to pay Participant a mutually agreeable reasonable
- royalty for Your past and future use of Modifications made by such
- Participant, or (ii) withdraw Your litigation claim with respect to
- the Contributor Version against such Participant. If within 60 days
- of notice, a reasonable royalty and payment arrangement are not
- mutually agreed upon in writing by the parties or the litigation claim
- is not withdrawn, the rights granted by Participant to You under
- Sections 2.1 and/or 2.2 automatically terminate at the expiration of
- the 60 day notice period specified above.
-
- (b) any software, hardware, or device, other than such Participant's
- Contributor Version, directly or indirectly infringes any patent, then
- any rights granted to You by such Participant under Sections 2.1(b)
- and 2.2(b) are revoked effective as of the date You first made, used,
- sold, distributed, or had made, Modifications made by that
- Participant.
-
- 8.3. If You assert a patent infringement claim against Participant
- alleging that such Participant's Contributor Version directly or
- indirectly infringes any patent where such claim is resolved (such as
- by license or settlement) prior to the initiation of patent
- infringement litigation, then the reasonable value of the licenses
- granted by such Participant under Sections 2.1 or 2.2 shall be taken
- into account in determining the amount or value of any payment or
- license.
-
- 8.4. In the event of termination under Sections 8.1 or 8.2 above,
- all end user license agreements (excluding distributors and resellers)
- which have been validly granted by You or any distributor hereunder
- prior to termination shall survive termination.
-
-9. LIMITATION OF LIABILITY.
-
- UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
- (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
- DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
- OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
- ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
- CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
- WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
- COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
- INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
- LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
- RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
- PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
- EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
- THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
-
-10. U.S. GOVERNMENT END USERS.
-
- The Covered Code is a "commercial item," as that term is defined in
- 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
- software" and "commercial computer software documentation," as such
- terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
- C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
- all U.S. Government End Users acquire Covered Code with only those
- rights set forth herein.
-
-11. MISCELLANEOUS.
-
- This License represents the complete agreement concerning subject
- matter hereof. If any provision of this License is held to be
- unenforceable, such provision shall be reformed only to the extent
- necessary to make it enforceable. This License shall be governed by
- California law provisions (except to the extent applicable law, if
- any, provides otherwise), excluding its conflict-of-law provisions.
- With respect to disputes in which at least one party is a citizen of,
- or an entity chartered or registered to do business in the United
- States of America, any litigation relating to this License shall be
- subject to the jurisdiction of the Federal Courts of the Northern
- District of California, with venue lying in Santa Clara County,
- California, with the losing party responsible for costs, including
- without limitation, court costs and reasonable attorneys' fees and
- expenses. The application of the United Nations Convention on
- Contracts for the International Sale of Goods is expressly excluded.
- Any law or regulation which provides that the language of a contract
- shall be construed against the drafter shall not apply to this
- License.
-
-12. RESPONSIBILITY FOR CLAIMS.
-
- As between Initial Developer and the Contributors, each party is
- responsible for claims and damages arising, directly or indirectly,
- out of its utilization of rights under this License and You agree to
- work with Initial Developer and Contributors to distribute such
- responsibility on an equitable basis. Nothing herein is intended or
- shall be deemed to constitute any admission of liability.
-
-13. MULTIPLE-LICENSED CODE.
-
- Initial Developer may designate portions of the Covered Code as
- "Multiple-Licensed". "Multiple-Licensed" means that the Initial
- Developer permits you to utilize portions of the Covered Code under
- Your choice of the NPL or the alternative licenses, if any, specified
- by the Initial Developer in the file described in Exhibit A.
-
-EXHIBIT A -Mozilla Public License.
-
- ``The contents of this file are subject to the Mozilla Public License
- Version 1.1 (the "License"); you may not use this file except in
- compliance with the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- License for the specific language governing rights and limitations
- under the License.
-
- The Original Code is RabbitMQ.
-
- The Initial Developer of the Original Code is GoPivotal, Inc.
- Copyright (c) 2007-2015 Pivotal Software, Inc. All rights reserved.''
-
- [NOTE: The text of this Exhibit A may differ slightly from the text of
- the notices in the Source Code files of the Original Code. You should
- use the text of this Exhibit A rather than the text found in the
- Original Code Source Code for Your Modifications.]
diff --git a/packaging/debs/Debian/.gitignore b/packaging/debs/Debian/.gitignore
deleted file mode 100644
index 6a4aec11b5..0000000000
--- a/packaging/debs/Debian/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/debian/postrm
-/debian/stamp-makefile-build
-/rabbitmq-server_*
diff --git a/packaging/debs/Debian/Makefile b/packaging/debs/Debian/Makefile
deleted file mode 100644
index df01eee588..0000000000
--- a/packaging/debs/Debian/Makefile
+++ /dev/null
@@ -1,57 +0,0 @@
-SOURCE_DIST_FILE ?= $(wildcard ../../../rabbitmq-server-*.tar.xz)
-
-ifneq ($(filter-out clean,$(MAKECMDGOALS)),)
-ifeq ($(SOURCE_DIST_FILE),)
-$(error Cannot find source archive; please specify SOURCE_DIST_FILE)
-endif
-ifneq ($(words $(SOURCE_DIST_FILE)),1)
-$(error Multile source archives found; please specify SOURCE_DIST_FILE)
-endif
-
-VERSION ?= $(patsubst rabbitmq-server-%.tar.xz,%,$(notdir $(SOURCE_DIST_FILE)))
-ifeq ($(VERSION),)
-$(error Cannot determine version; please specify VERSION)
-endif
-endif
-
-DEBIAN_ORIG_TARBALL = rabbitmq-server_$(VERSION).orig.tar.xz
-UNPACKED_DIR = rabbitmq-server-$(VERSION)
-PACKAGENAME = rabbitmq-server
-
-ifneq "$(UNOFFICIAL_RELEASE)" ""
- SIGNING=-us -uc
-else
- SIGNING=-k$(SIGNING_KEY)
-endif
-
-unexport DEPS_DIR
-unexport ERL_LIBS
-
-all: package
- @:
-
-package: clean
- cp -a $(SOURCE_DIST_FILE) $(DEBIAN_ORIG_TARBALL)
- xzcat $(DEBIAN_ORIG_TARBALL) | tar -xf -
- cp -a debian $(UNPACKED_DIR)
- rsync -a \
- --exclude '.sw?' --exclude '.*.sw?' \
- --exclude '.git*' \
- --delete --delete-excluded \
- debian/ $(UNPACKED_DIR)/debian/
- UNOFFICIAL_RELEASE=$(UNOFFICIAL_RELEASE) VERSION=$(VERSION) ./check-changelog.sh rabbitmq-server $(UNPACKED_DIR)
- cd $(UNPACKED_DIR); GNUPGHOME=$(GNUPG_PATH)/.gnupg dpkg-buildpackage -sa $(SIGNING)
- rm -rf $(UNPACKED_DIR)
-
- if test "$(PACKAGES_DIR)"; then \
- mkdir -p "$(PACKAGES_DIR)"; \
- mv $(PACKAGENAME)_$(VERSION)* "$(PACKAGES_DIR)"; \
- fi
-
-clean:
- rm -rf $(UNPACKED_DIR)
- rm -f $(DEBIAN_ORIG_TARBALL)
- rm -f $(PACKAGENAME)_*.debian.tar.gz
- rm -f $(PACKAGENAME)_*.dsc
- rm -f $(PACKAGENAME)_*_*.changes
- rm -f $(PACKAGENAME)_*_*.deb
diff --git a/packaging/debs/Debian/changelog_comments/additional_changelog_comments_3.3.5 b/packaging/debs/Debian/changelog_comments/additional_changelog_comments_3.3.5
deleted file mode 100644
index b9a9551c6b..0000000000
--- a/packaging/debs/Debian/changelog_comments/additional_changelog_comments_3.3.5
+++ /dev/null
@@ -1,9 +0,0 @@
-# This file contains additional comments for the debian/changelog to be
-# appended within the current version's changelog entry.
-# Each line will be a separate comment. Do not begin with an *, dch will
-# add that.
-# For comments longer than one line do not put a line break and dch will
-# neatly format it.
-# Shell comments are ignored.
-#
-Changed Uploaders from Emile Joubert to Blair Hester
diff --git a/packaging/debs/Debian/changelog_comments/additional_changelog_comments_x.x.x b/packaging/debs/Debian/changelog_comments/additional_changelog_comments_x.x.x
deleted file mode 100644
index bbab75965e..0000000000
--- a/packaging/debs/Debian/changelog_comments/additional_changelog_comments_x.x.x
+++ /dev/null
@@ -1,11 +0,0 @@
-# This file contains additional comments for the debian/changelog to be
-# appended within the current version's changelog entry.
-# Each line will be a separate comment. Do not begin with an *, dch will
-# add that.
-# For comments longer than one line do not put a line break and dch will
-# neatly format it.
-# Shell comments are ignored.
-#
-# Examples:
-#Remove parts made of undercooked chicken
-#This is a long line which is the beginning of a long two line comment which I am sure is going to be needed if the script cannot handle it
diff --git a/packaging/debs/Debian/check-changelog.sh b/packaging/debs/Debian/check-changelog.sh
deleted file mode 100755
index ff25e648fc..0000000000
--- a/packaging/debs/Debian/check-changelog.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-
-PACKAGE_NAME=$1
-cd $2
-
-CHANGELOG_VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: \(.*\)-[^-]*$/\1/p')
-
-if [ "${CHANGELOG_VERSION}" != "${VERSION}" ]; then
- if [ -n "${UNOFFICIAL_RELEASE}" ]; then
- echo "${PACKAGE_NAME} (${VERSION}-1) unstable; urgency=low" > debian/changelog.tmp
- echo >> debian/changelog.tmp
- echo " * Unofficial release" >> debian/changelog.tmp
- echo >> debian/changelog.tmp
- echo " -- Nobody <nobody@example.com> $(date -R)" >> debian/changelog.tmp
- echo >> debian/changelog.tmp
- cat debian/changelog >> debian/changelog.tmp
- mv -f debian/changelog.tmp debian/changelog
-
- exit 0
- else
- echo
- echo There is no entry in debian/changelog for version ${VERSION}!
- echo Please create a changelog entry, or set the variable
- echo UNOFFICIAL_RELEASE to automatically create one.
- echo
-
- exit 1
- fi
-fi
diff --git a/packaging/debs/Debian/debian/changelog b/packaging/debs/Debian/debian/changelog
deleted file mode 100644
index e7e9bd3760..0000000000
--- a/packaging/debs/Debian/debian/changelog
+++ /dev/null
@@ -1,427 +0,0 @@
-rabbitmq-server (3.6.5-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Michael Klishin <michael@rabbitmq.com> Fri, 05 Aug 2016 14:20:47 +0100
-
-rabbitmq-server (3.6.4-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Michael Klishin <michael@rabbitmq.com> Fri, 29 Jul 2016 11:40:53 +0100
-
-rabbitmq-server (3.6.3-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Michael Klishin <michael@rabbitmq.com> Wed, 06 Jul 2016 19:19:21 +0100
-
-rabbitmq-server (3.6.2-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Michael Klishin <michael@rabbitmq.com> Thu, 19 May 2016 09:20:06 +0100
-
-rabbitmq-server (3.6.1-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Michael Klishin <michael@rabbitmq.com> Tue, 01 Mar 2016 13:19:57 +0000
-
-rabbitmq-server (3.6.0-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Michael Klishin <michael@rabbitmq.com> Tue, 22 Dec 2015 13:21:56 +0000
-
-rabbitmq-server (3.5.7-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Michael Klishin <michael@rabbitmq.com> Tue, 15 Dec 2015 10:10:46 +0000
-
-rabbitmq-server (3.5.6-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Michael Klishin <michael@rabbitmq.com> Wed, 07 Oct 2015 13:31:24 +0100
-
-rabbitmq-server (3.5.5-3) unstable; urgency=low
-
- * Fix bashism in rabbitmq-script-wrapper
-
- -- Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> Thu, 24 Sep 2015 19:18:17 +0100
-
-rabbitmq-server (3.5.5-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> Thu, 24 Sep 2015 10:57:25 +0100
-
-rabbitmq-server (3.5.4-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Michael Klishin <michael@rabbitmq.com> Tue, 21 Jul 2015 20:25:48 +0100
-
-rabbitmq-server (3.5.3-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> Fri, 22 May 2015 11:04:17 +0100
-
-rabbitmq-server (3.5.2-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> Tue, 12 May 2015 16:21:44 +0100
-
-rabbitmq-server (3.5.1-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Michael Klishin <michael@rabbitmq.com> Thu, 02 Apr 2015 10:17:30 +0100
-
-rabbitmq-server (3.5.0-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> Wed, 11 Mar 2015 13:56:19 +0000
-
-rabbitmq-server (3.4.4-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Michael Klishin <michael@rabbitmq.com> Wed, 11 Feb 2015 12:05:01 +0000
-
-rabbitmq-server (3.4.3-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> Tue, 06 Jan 2015 15:58:45 +0000
-
-rabbitmq-server (3.4.2-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Simon MacMullen <simon@rabbitmq.com> Wed, 26 Nov 2014 12:11:12 +0000
-
-rabbitmq-server (3.4.1-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Simon MacMullen <simon@rabbitmq.com> Wed, 29 Oct 2014 13:31:10 +0000
-
-rabbitmq-server (3.4.0-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Simon MacMullen <simon@rabbitmq.com> Tue, 21 Oct 2014 14:21:36 +0100
-
-rabbitmq-server (3.3.5-1) unstable; urgency=low
-
- * New Upstream Release
- * Changed Uploaders from Emile Joubert to Blair Hester
-
- -- Simon MacMullen <simon@rabbitmq.com> Mon, 11 Aug 2014 12:23:31 +0100
-
-rabbitmq-server (3.3.4-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Simon MacMullen <simon@rabbitmq.com> Tue, 24 Jun 2014 12:50:29 +0100
-
-rabbitmq-server (3.3.3-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Simon MacMullen <simon@rabbitmq.com> Mon, 16 Jun 2014 13:00:00 +0100
-
-rabbitmq-server (3.3.2-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Simon MacMullen <simon@rabbitmq.com> Mon, 09 Jun 2014 10:25:22 +0100
-
-rabbitmq-server (3.3.1-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Simon MacMullen <simon@rabbitmq.com> Tue, 29 Apr 2014 11:49:23 +0100
-
-rabbitmq-server (3.3.0-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Simon MacMullen <simon@rabbitmq.com> Wed, 02 Apr 2014 14:23:14 +0100
-
-rabbitmq-server (3.2.4-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Simon MacMullen <simon@rabbitmq.com> Mon, 03 Mar 2014 14:50:18 +0000
-
-rabbitmq-server (3.2.3-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Emile Joubert <emile@rabbitmq.com> Thu, 23 Jan 2014 14:46:37 +0000
-
-rabbitmq-server (3.2.2-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Emile Joubert <emile@rabbitmq.com> Tue, 10 Dec 2013 16:08:08 +0000
-
-rabbitmq-server (3.2.0-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Emile Joubert <emile@rabbitmq.com> Wed, 23 Oct 2013 12:44:10 +0100
-
-rabbitmq-server (3.1.5-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Simon MacMullen <simon@rabbitmq.com> Thu, 15 Aug 2013 11:03:13 +0100
-
-rabbitmq-server (3.1.3-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Tim Watson <tim@rabbitmq.com> Tue, 25 Jun 2013 15:01:12 +0100
-
-rabbitmq-server (3.1.2-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Tim Watson <tim@rabbitmq.com> Mon, 24 Jun 2013 11:16:41 +0100
-
-rabbitmq-server (3.1.1-1) unstable; urgency=low
-
- * Test release
-
- -- Tim Watson <tim@rabbitmq.com> Mon, 20 May 2013 16:21:20 +0100
-
-rabbitmq-server (3.1.0-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Simon MacMullen <simon@rabbitmq.com> Wed, 01 May 2013 11:57:58 +0100
-
-rabbitmq-server (3.0.1-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Simon MacMullen <simon@rabbitmq.com> Tue, 11 Dec 2012 11:29:55 +0000
-
-rabbitmq-server (3.0.0-1) unstable; urgency=low
-
- * New Upstream Release
-
- -- Simon MacMullen <simon@rabbitmq.com> Fri, 16 Nov 2012 14:15:29 +0000
-
-rabbitmq-server (2.7.1-1) natty; urgency=low
-
- * New Upstream Release
-
- -- Steve Powell <steve@rabbitmq.com> Fri, 16 Dec 2011 12:12:36 +0000
-
-rabbitmq-server (2.7.0-1) natty; urgency=low
-
- * New Upstream Release
-
- -- Steve Powell <steve@rabbitmq.com> Tue, 08 Nov 2011 16:47:50 +0000
-
-rabbitmq-server (2.6.1-1) natty; urgency=low
-
- * New Upstream Release
-
- -- Tim <tim@rabbitmq.com> Fri, 09 Sep 2011 14:38:45 +0100
-
-rabbitmq-server (2.6.0-1) natty; urgency=low
-
- * New Upstream Release
-
- -- Tim <tim@rabbitmq.com> Fri, 26 Aug 2011 16:29:40 +0100
-
-rabbitmq-server (2.5.1-1) lucid; urgency=low
-
- * New Upstream Release
-
- -- Simon MacMullen <simon@rabbitmq.com> Mon, 27 Jun 2011 11:21:49 +0100
-
-rabbitmq-server (2.5.0-1) lucid; urgency=low
-
- * New Upstream Release
-
- -- <jerryk@vmware.com> Thu, 09 Jun 2011 07:20:29 -0700
-
-rabbitmq-server (2.4.1-1) lucid; urgency=low
-
- * New Upstream Release
-
- -- Alexandru Scvortov <alexandru@rabbitmq.com> Thu, 07 Apr 2011 16:49:22 +0100
-
-rabbitmq-server (2.4.0-1) lucid; urgency=low
-
- * New Upstream Release
-
- -- Alexandru Scvortov <alexandru@rabbitmq.com> Tue, 22 Mar 2011 17:34:31 +0000
-
-rabbitmq-server (2.3.1-1) lucid; urgency=low
-
- * New Upstream Release
-
- -- Simon MacMullen <simon@rabbitmq.com> Thu, 03 Feb 2011 12:43:56 +0000
-
-rabbitmq-server (2.3.0-1) lucid; urgency=low
-
- * New Upstream Release
-
- -- Simon MacMullen <simon@rabbitmq.com> Tue, 01 Feb 2011 12:52:16 +0000
-
-rabbitmq-server (2.2.0-1) lucid; urgency=low
-
- * New Upstream Release
-
- -- Rob Harrop <rob@rabbitmq.com> Mon, 29 Nov 2010 12:24:48 +0000
-
-rabbitmq-server (2.1.1-1) lucid; urgency=low
-
- * New Upstream Release
-
- -- Vlad Alexandru Ionescu <vlad@rabbitmq.com> Tue, 19 Oct 2010 17:20:10 +0100
-
-rabbitmq-server (2.1.0-1) lucid; urgency=low
-
- * New Upstream Release
-
- -- Marek Majkowski <marek@rabbitmq.com> Tue, 14 Sep 2010 14:20:17 +0100
-
-rabbitmq-server (2.0.0-1) karmic; urgency=low
-
- * New Upstream Release
-
- -- Michael Bridgen <mikeb@rabbitmq.com> Mon, 23 Aug 2010 14:55:39 +0100
-
-rabbitmq-server (1.8.1-1) lucid; urgency=low
-
- * New Upstream Release
-
- -- Emile Joubert <emile@rabbitmq.com> Wed, 14 Jul 2010 15:05:24 +0100
-
-rabbitmq-server (1.8.0-1) intrepid; urgency=low
-
- * New Upstream Release
-
- -- Matthew Sackman <matthew@rabbitmq.com> Tue, 15 Jun 2010 12:48:48 +0100
-
-rabbitmq-server (1.7.2-1) intrepid; urgency=low
-
- * New Upstream Release
-
- -- Matthew Sackman <matthew@lshift.net> Mon, 15 Feb 2010 15:54:47 +0000
-
-rabbitmq-server (1.7.1-1) intrepid; urgency=low
-
- * New Upstream Release
-
- -- Matthew Sackman <matthew@lshift.net> Fri, 22 Jan 2010 14:14:29 +0000
-
-rabbitmq-server (1.7.0-1) intrepid; urgency=low
-
- * New Upstream Release
-
- -- David Wragg <dpw@lshift.net> Mon, 05 Oct 2009 13:44:41 +0100
-
-rabbitmq-server (1.6.0-1) hardy; urgency=low
-
- * New Upstream Release
-
- -- Matthias Radestock <matthias@lshift.net> Tue, 16 Jun 2009 15:02:58 +0100
-
-rabbitmq-server (1.5.5-1) hardy; urgency=low
-
- * New Upstream Release
-
- -- Matthias Radestock <matthias@lshift.net> Tue, 19 May 2009 09:57:54 +0100
-
-rabbitmq-server (1.5.4-1) hardy; urgency=low
-
- * New Upstream Release
-
- -- Matthias Radestock <matthias@lshift.net> Mon, 06 Apr 2009 09:19:32 +0100
-
-rabbitmq-server (1.5.3-1) hardy; urgency=low
-
- * New Upstream Release
-
- -- Tony Garnock-Jones <tonyg@lshift.net> Tue, 24 Feb 2009 18:23:33 +0000
-
-rabbitmq-server (1.5.2-1) hardy; urgency=low
-
- * New Upstream Release
-
- -- Tony Garnock-Jones <tonyg@lshift.net> Mon, 23 Feb 2009 16:03:38 +0000
-
-rabbitmq-server (1.5.1-1) hardy; urgency=low
-
- * New Upstream Release
-
- -- Simon MacMullen <simon@lshift.net> Mon, 19 Jan 2009 15:46:13 +0000
-
-rabbitmq-server (1.5.0-1) testing; urgency=low
-
- * New Upstream Release
-
- -- Matthias Radestock <matthias@lshift.net> Wed, 17 Dec 2008 18:23:47 +0000
-
-rabbitmq-server (1.4.0-1) testing; urgency=low
-
- * New Upstream Release
-
- -- Tony Garnock-Jones <tonyg@lshift.net> Thu, 24 Jul 2008 13:21:48 +0100
-
-rabbitmq-server (1.3.0-1) testing; urgency=low
-
- * New Upstream Release
-
- -- Adrien Pierard <adrien@lshift.net> Mon, 03 Mar 2008 15:34:38 +0000
-
-rabbitmq-server (1.2.0-2) testing; urgency=low
-
- * Fixed rabbitmqctl wrapper script
-
- -- Simon MacMullen <simon@lshift.net> Fri, 05 Oct 2007 11:55:00 +0100
-
-rabbitmq-server (1.2.0-1) testing; urgency=low
-
- * New upstream release
-
- -- Simon MacMullen <simon@lshift.net> Wed, 26 Sep 2007 11:49:26 +0100
-
-rabbitmq-server (1.1.1-1) testing; urgency=low
-
- * New upstream release
-
- -- Simon MacMullen <simon@lshift.net> Wed, 29 Aug 2007 12:03:15 +0100
-
-rabbitmq-server (1.1.0-alpha-2) testing; urgency=low
-
- * Fixed erlang-nox dependency
-
- -- Simon MacMullen <simon@lshift.net> Thu, 02 Aug 2007 11:27:13 +0100
-
-rabbitmq-server (1.1.0-alpha-1) testing; urgency=low
-
- * New upstream release
-
- -- Simon MacMullen <simon@lshift.net> Fri, 20 Jul 2007 18:17:33 +0100
-
-rabbitmq-server (1.0.0-alpha-1) unstable; urgency=low
-
- * Initial release
-
- -- Tony Garnock-Jones <tonyg@shortstop.lshift.net> Wed, 31 Jan 2007 19:06:33 +0000
-
diff --git a/packaging/debs/Debian/debian/compat b/packaging/debs/Debian/debian/compat
deleted file mode 100644
index ec635144f6..0000000000
--- a/packaging/debs/Debian/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-9
diff --git a/packaging/debs/Debian/debian/control b/packaging/debs/Debian/debian/control
deleted file mode 100644
index 050051ba3f..0000000000
--- a/packaging/debs/Debian/debian/control
+++ /dev/null
@@ -1,24 +0,0 @@
-Source: rabbitmq-server
-Section: net
-Priority: extra
-Maintainer: RabbitMQ Team <info@rabbitmq.com>
-Uploaders: Michael Klishin <michael@rabbitmq.com>,
- Karl Nilsson <knilsson@rabbitmq.com>,
- Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com>
-Build-Depends: debhelper (>= 9),
- dh-systemd (>= 1.5),
- erlang-dev,
- python-simplejson,
- xmlto,
- xsltproc,
- erlang-nox (>= 1:16.b.3) | esl-erlang,
- zip,
- rsync
-Standards-Version: 3.9.4
-
-Package: rabbitmq-server
-Architecture: all
-Depends: erlang-nox (>= 1:16.b.3) | esl-erlang, adduser, logrotate, socat, init-system-helpers (>= 1.13~)
-Description: Multi-protocol messaging broker
- RabbitMQ is an open source multi-protocol messaging broker.
-Homepage: http://www.rabbitmq.com/
diff --git a/packaging/debs/Debian/debian/copyright b/packaging/debs/Debian/debian/copyright
deleted file mode 100644
index 521b903754..0000000000
--- a/packaging/debs/Debian/debian/copyright
+++ /dev/null
@@ -1,52 +0,0 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: rabbitmq-server
-Upstream-Contact: Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com>
-Source: https://github.com/rabbitmq/rabbitmq-server
-
-Files: *
-Copyright: 2007-2015 Pivotal Software, Inc.
-License: MPL-1.1
-
-Files: src/mochinum.erl deps/rabbit_common/src/mochijson2.erl
-Copyright: 2007 Mochi Media, Inc.
-License: MIT
-
-License: MPL-1.1
- The contents of this file are subject to the Mozilla Public License
- Version 1.1 (the "License"); you may not use this file except in
- compliance with the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
- .
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License
- .
- The Original Code is RabbitMQ
- .
- The Initial Developer of the Original Code is Pivotal Software, Inc.
- Copyright (c) 2007-2015 Pivotal Software, Inc. All rights reserved.
-
-License: MIT
- This is the MIT license
- .
- Copyright (c) 2007 Mochi Media, Inc
- .
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions
- :
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software
- .
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/packaging/debs/Debian/debian/dirs b/packaging/debs/Debian/debian/dirs
deleted file mode 100644
index 625b7d41f5..0000000000
--- a/packaging/debs/Debian/debian/dirs
+++ /dev/null
@@ -1,9 +0,0 @@
-usr/lib/rabbitmq/bin
-usr/lib/erlang/lib
-usr/sbin
-usr/share/man
-var/lib/rabbitmq/mnesia
-var/log/rabbitmq
-etc/logrotate.d
-etc/rabbitmq
-
diff --git a/packaging/debs/Debian/debian/postinst b/packaging/debs/Debian/debian/postinst
deleted file mode 100644
index c83881e6ba..0000000000
--- a/packaging/debs/Debian/debian/postinst
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/sh
-# postinst script for rabbitmq
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-# * <postinst> `configure' <most-recently-configured-version>
-# * <old-postinst> `abort-upgrade' <new version>
-# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
-# <new-version>
-# * <postinst> `abort-remove'
-# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
-# <failed-install-package> <version> `removing'
-# <conflicting-package> <version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-# create rabbitmq group
-if ! getent group rabbitmq >/dev/null; then
- addgroup --system rabbitmq
-fi
-
-# create rabbitmq user
-if ! getent passwd rabbitmq >/dev/null; then
- adduser --system --ingroup rabbitmq --home /var/lib/rabbitmq \
- --no-create-home --gecos "RabbitMQ messaging server" \
- --disabled-login rabbitmq
-fi
-
-chown -R rabbitmq:rabbitmq /var/lib/rabbitmq
-chown -R rabbitmq:rabbitmq /var/log/rabbitmq
-chmod 750 /var/lib/rabbitmq/mnesia
-chmod -R o-rwx,g-w /var/lib/rabbitmq/mnesia
-
-case "$1" in
- configure)
- if [ -f /etc/rabbitmq/rabbitmq.conf ] && \
- [ ! -f /etc/rabbitmq/rabbitmq-env.conf ]; then
- mv /etc/rabbitmq/rabbitmq.conf /etc/rabbitmq/rabbitmq-env.conf
- fi
- ;;
-
- abort-upgrade|abort-remove|abort-deconfigure)
- ;;
-
- *)
- echo "postinst called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
-
-
diff --git a/packaging/debs/Debian/debian/postrm.in b/packaging/debs/Debian/debian/postrm.in
deleted file mode 100644
index c2e9bbfedc..0000000000
--- a/packaging/debs/Debian/debian/postrm.in
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/sh
-# postrm script for rabbitmq
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-# * <postrm> `remove'
-# * <postrm> `purge'
-# * <old-postrm> `upgrade' <new-version>
-# * <new-postrm> `failed-upgrade' <old-version>
-# * <new-postrm> `abort-install'
-# * <new-postrm> `abort-install' <old-version>
-# * <new-postrm> `abort-upgrade' <old-version>
-# * <disappearer's-postrm> `disappear' <overwriter>
-# <overwriter-version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-remove_plugin_traces() {
- # Remove traces of plugins
- rm -rf /var/lib/rabbitmq/plugins-scratch
-}
-
-case "$1" in
- purge)
- rm -f /etc/default/rabbitmq
- if [ -d /var/lib/rabbitmq ]; then
- rm -r /var/lib/rabbitmq
- fi
- if [ -d /var/log/rabbitmq ]; then
- rm -r /var/log/rabbitmq
- fi
- if [ -d /etc/rabbitmq ]; then
- rm -r /etc/rabbitmq
- fi
- remove_plugin_traces
- if getent passwd rabbitmq >/dev/null; then
- # Stop epmd if run by the rabbitmq user
- pkill -u rabbitmq epmd || :
- fi
- ;;
-
- remove|upgrade)
- remove_plugin_traces
- ;;
-
- failed-upgrade|abort-install|abort-upgrade|disappear)
- ;;
-
- *)
- echo "postrm called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
-
-
diff --git a/packaging/debs/Debian/debian/rabbitmq-server.default b/packaging/debs/Debian/debian/rabbitmq-server.default
deleted file mode 100644
index bde5e30895..0000000000
--- a/packaging/debs/Debian/debian/rabbitmq-server.default
+++ /dev/null
@@ -1,9 +0,0 @@
-# This file is sourced by /etc/init.d/rabbitmq-server. Its primary
-# reason for existing is to allow adjustment of system limits for the
-# rabbitmq-server process.
-#
-# Maximum number of open file handles. This will need to be increased
-# to handle many simultaneous connections. Refer to the system
-# documentation for ulimit (in man bash) for more information.
-#
-#ulimit -n 1024
diff --git a/packaging/debs/Debian/debian/rabbitmq-server.docs b/packaging/debs/Debian/debian/rabbitmq-server.docs
deleted file mode 100644
index fbe9f95a05..0000000000
--- a/packaging/debs/Debian/debian/rabbitmq-server.docs
+++ /dev/null
@@ -1,2 +0,0 @@
-docs/rabbitmq.config.example
-docs/set_rabbitmq_policy.sh.example
diff --git a/packaging/debs/Debian/debian/rabbitmq-server.init b/packaging/debs/Debian/debian/rabbitmq-server.init
deleted file mode 100644
index fce2d16401..0000000000
--- a/packaging/debs/Debian/debian/rabbitmq-server.init
+++ /dev/null
@@ -1,191 +0,0 @@
-#!/bin/sh
-#
-# rabbitmq-server RabbitMQ broker
-#
-# chkconfig: - 80 05
-# description: Manages RabbitMQ server
-#
-
-### BEGIN INIT INFO
-# Provides: rabbitmq-server
-# Required-Start: $remote_fs $network
-# Required-Stop: $remote_fs $network
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Description: RabbitMQ broker
-# Short-Description: Manages RabbitMQ server
-### END INIT INFO
-
-PATH=/sbin:/usr/sbin:/bin:/usr/bin
-NAME=rabbitmq-server
-DAEMON=/usr/sbin/${NAME}
-CONTROL=/usr/sbin/rabbitmqctl
-DESC="message broker"
-USER=rabbitmq
-ROTATE_SUFFIX=
-PID_FILE=/var/run/rabbitmq/pid
-RABBITMQ_ENV=/usr/lib/rabbitmq/bin/rabbitmq-env
-
-test -x $DAEMON || exit 0
-test -x $CONTROL || exit 0
-
-RETVAL=0
-set -e
-
-[ -f /etc/default/${NAME} ] && . /etc/default/${NAME}
-
-RABBITMQ_SCRIPTS_DIR=$(dirname "$RABBITMQ_ENV")
-. "$RABBITMQ_ENV"
-
-. /lib/lsb/init-functions
-. /lib/init/vars.sh
-
-ensure_pid_dir () {
- PID_DIR=`dirname ${PID_FILE}`
- if [ ! -d ${PID_DIR} ] ; then
- mkdir -p ${PID_DIR}
- chown -R ${USER}:${USER} ${PID_DIR}
- chmod 755 ${PID_DIR}
- fi
-}
-
-remove_pid () {
- rm -f ${PID_FILE}
- rmdir `dirname ${PID_FILE}` || :
-}
-
-start_rabbitmq () {
- status_rabbitmq quiet
- if [ $RETVAL != 0 ] ; then
- RETVAL=0
- ensure_pid_dir
- set +e
- RABBITMQ_PID_FILE=$PID_FILE start-stop-daemon --quiet \
- --chuid rabbitmq --start --exec $DAEMON \
- --pidfile "$PID_FILE" --background
- $CONTROL wait $PID_FILE >/dev/null 2>&1
- RETVAL=$?
- set -e
- if [ $RETVAL != 0 ] ; then
- remove_pid
- fi
- else
- RETVAL=3
- fi
-}
-
-stop_rabbitmq () {
- status_rabbitmq quiet
- if [ $RETVAL = 0 ] ; then
- set +e
- $CONTROL stop ${PID_FILE} \
- > ${RABBITMQ_LOG_BASE}/shutdown_log \
- 2> ${RABBITMQ_LOG_BASE}/shutdown_err
- RETVAL=$?
- set -e
- if [ $RETVAL = 0 ] ; then
- remove_pid
- fi
- else
- RETVAL=3
- fi
-}
-
-status_rabbitmq() {
- set +e
- if [ "$1" != "quiet" ] ; then
- $CONTROL status 2>&1
- else
- $CONTROL status > /dev/null 2>&1
- fi
- if [ $? != 0 ] ; then
- RETVAL=3
- fi
- set -e
-}
-
-rotate_logs_rabbitmq() {
- set +e
- $CONTROL -q rotate_logs ${ROTATE_SUFFIX}
- if [ $? != 0 ] ; then
- RETVAL=1
- fi
- set -e
-}
-
-restart_running_rabbitmq () {
- status_rabbitmq quiet
- if [ $RETVAL = 0 ] ; then
- restart_rabbitmq
- else
- log_warning_msg "${DESC} not running"
- fi
-}
-
-restart_rabbitmq() {
- stop_rabbitmq
- start_rabbitmq
-}
-
-restart_end() {
- if [ $RETVAL = 0 ] ; then
- log_end_msg 0
- else
- log_end_msg 1
- fi
-}
-
-start_stop_end() {
- case "$RETVAL" in
- 0)
- [ -x /sbin/initctl ] && /sbin/initctl emit --no-wait "${NAME}-${1}"
- log_end_msg 0
- ;;
- 3)
- log_warning_msg "${DESC} already ${1}"
- log_end_msg 0
- RETVAL=0
- ;;
- *)
- log_warning_msg "FAILED - check ${RABBITMQ_LOG_BASE}/startup_\{log, _err\}"
- log_end_msg 1
- ;;
- esac
-}
-
-case "$1" in
- start)
- log_daemon_msg "Starting ${DESC}" $NAME
- start_rabbitmq
- start_stop_end "running"
- ;;
- stop)
- log_daemon_msg "Stopping ${DESC}" $NAME
- stop_rabbitmq
- start_stop_end "stopped"
- ;;
- status)
- status_rabbitmq
- ;;
- rotate-logs)
- log_action_begin_msg "Rotating log files for ${DESC}: ${NAME}"
- rotate_logs_rabbitmq
- log_action_end_msg $RETVAL
- ;;
- force-reload|reload|restart)
- log_daemon_msg "Restarting ${DESC}" $NAME
- restart_rabbitmq
- restart_end
- ;;
- try-restart)
- log_daemon_msg "Restarting ${DESC}" $NAME
- restart_running_rabbitmq
- restart_end
- ;;
- *)
- echo "Usage: $0 {start|stop|status|rotate-logs|restart|condrestart|try-restart|reload|force-reload}" >&2
- RETVAL=1
- ;;
-esac
-
-exit $RETVAL
diff --git a/packaging/debs/Debian/debian/rabbitmq-server.logrotate b/packaging/debs/Debian/debian/rabbitmq-server.logrotate
deleted file mode 100644
index c786df77b2..0000000000
--- a/packaging/debs/Debian/debian/rabbitmq-server.logrotate
+++ /dev/null
@@ -1,12 +0,0 @@
-/var/log/rabbitmq/*.log {
- weekly
- missingok
- rotate 20
- compress
- delaycompress
- notifempty
- sharedscripts
- postrotate
- /etc/init.d/rabbitmq-server rotate-logs > /dev/null
- endscript
-}
diff --git a/packaging/debs/Debian/debian/rabbitmq-server.manpages b/packaging/debs/Debian/debian/rabbitmq-server.manpages
deleted file mode 100644
index e0220b47c3..0000000000
--- a/packaging/debs/Debian/debian/rabbitmq-server.manpages
+++ /dev/null
@@ -1,4 +0,0 @@
-docs/rabbitmq-env.conf.5
-docs/rabbitmq-plugins.1
-docs/rabbitmq-server.1
-docs/rabbitmqctl.1
diff --git a/packaging/debs/Debian/debian/rabbitmq-server.service b/packaging/debs/Debian/debian/rabbitmq-server.service
deleted file mode 100644
index 1aa6549b64..0000000000
--- a/packaging/debs/Debian/debian/rabbitmq-server.service
+++ /dev/null
@@ -1,18 +0,0 @@
-# systemd unit example
-[Unit]
-Description=RabbitMQ broker
-After=network.target epmd@0.0.0.0.socket
-Wants=network.target epmd@0.0.0.0.socket
-
-[Service]
-Type=notify
-User=rabbitmq
-Group=rabbitmq
-NotifyAccess=all
-TimeoutStartSec=3600
-WorkingDirectory=/var/lib/rabbitmq
-ExecStart=/usr/lib/rabbitmq/bin/rabbitmq-server
-ExecStop=/usr/lib/rabbitmq/bin/rabbitmqctl stop
-
-[Install]
-WantedBy=multi-user.target
diff --git a/packaging/debs/Debian/debian/rules b/packaging/debs/Debian/debian/rules
deleted file mode 100755
index 770eeb0ea5..0000000000
--- a/packaging/debs/Debian/debian/rules
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-DEB_DESTDIR = debian/rabbitmq-server
-VERSION = $(shell dpkg-parsechangelog | awk '/^Version:/ {version=$$0; sub(/Version: /, "", version); sub(/-.*/, "", version); print version;}')
-
-%:
- dh $@ --parallel --with systemd
-
-override_dh_auto_clean:
- $(MAKE) clean distclean-manpages
-
-override_dh_auto_build:
- $(MAKE) dist manpages
-
-override_dh_auto_test:
- @:
-
-export PREFIX RMQ_ROOTDIR
-
-override_dh_auto_install: PREFIX = /usr
-override_dh_auto_install: RMQ_ROOTDIR = $(PREFIX)/lib/rabbitmq
-override_dh_auto_install: RMQ_ERLAPP_DIR = $(RMQ_ROOTDIR)/lib/rabbitmq_server-$(VERSION)
-override_dh_auto_install:
- dh_auto_install
-
- $(MAKE) install-bin DESTDIR=$(DEB_DESTDIR)
-
- sed -e 's|@RABBIT_LIB@|$(RMQ_ERLAPP_DIR)|g' \
- < debian/postrm.in > debian/postrm
-
- sed -e 's|@SU_RABBITMQ_SH_C@|su rabbitmq -s /bin/sh -c|' \
- -e 's|@STDOUT_STDERR_REDIRECTION@|> "$$RABBITMQ_LOG_BASE/startup_log" 2> "$$RABBITMQ_LOG_BASE/startup_err"|' \
- < scripts/rabbitmq-script-wrapper \
- > $(DEB_DESTDIR)$(PREFIX)/sbin/rabbitmqctl
- chmod 0755 $(DEB_DESTDIR)$(PREFIX)/sbin/rabbitmqctl
- for script in rabbitmq-server rabbitmq-plugins; do \
- cp -a $(DEB_DESTDIR)$(PREFIX)/sbin/rabbitmqctl \
- $(DEB_DESTDIR)$(PREFIX)/sbin/$$script; \
- done
-
- install -p -D -m 0644 debian/rabbitmq-server.default \
- $(DEB_DESTDIR)/etc/default/rabbitmq-server
-
- install -p -D -m 0755 scripts/rabbitmq-server.ocf \
- $(DEB_DESTDIR)$(PREFIX)/lib/ocf/resource.d/rabbitmq/rabbitmq-server
- install -p -D -m 0755 scripts/rabbitmq-server-ha.ocf \
- $(DEB_DESTDIR)$(PREFIX)/lib/ocf/resource.d/rabbitmq/rabbitmq-server-ha
-
- rm $(DEB_DESTDIR)$(RMQ_ERLAPP_DIR)/LICENSE* \
- $(DEB_DESTDIR)$(RMQ_ERLAPP_DIR)/INSTALL
-
- rmdir $(DEB_DESTDIR)$(PREFIX)/lib/erlang/lib \
- $(DEB_DESTDIR)$(PREFIX)/lib/erlang
diff --git a/packaging/debs/Debian/debian/source/format b/packaging/debs/Debian/debian/source/format
deleted file mode 100644
index 163aaf8d82..0000000000
--- a/packaging/debs/Debian/debian/source/format
+++ /dev/null
@@ -1 +0,0 @@
-3.0 (quilt)
diff --git a/packaging/debs/Debian/debian/watch b/packaging/debs/Debian/debian/watch
deleted file mode 100644
index b41aff9aed..0000000000
--- a/packaging/debs/Debian/debian/watch
+++ /dev/null
@@ -1,4 +0,0 @@
-version=3
-
-http://www.rabbitmq.com/releases/rabbitmq-server/v(.*)/rabbitmq-server-(\d.*)\.tar\.gz \
- debian uupdate
diff --git a/packaging/debs/apt-repository/Makefile b/packaging/debs/apt-repository/Makefile
deleted file mode 100644
index dbf8871a51..0000000000
--- a/packaging/debs/apt-repository/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-PACKAGES_DIR ?= ../../../PACKAGES
-REPO_DIR ?= debian
-
-SIGNING_KEY ?= default
-
-ifeq "$(UNOFFICIAL_RELEASE)" ""
-HOME_ARG = HOME=$(GNUPG_PATH)
-endif
-
-all: debian_apt_repository
-
-clean:
- rm -rf $(REPO_DIR)
-
-CAN_HAS_REPREPRO=$(shell [ -f /usr/bin/reprepro ] && echo true)
-ifeq ($(CAN_HAS_REPREPRO), true)
-debian_apt_repository: clean
- mkdir -p $(REPO_DIR)/conf
- cp -a distributions $(REPO_DIR)/conf
-ifeq "$(UNOFFICIAL_RELEASE)" ""
- echo SignWith: $(SIGNING_KEY) >> $(REPO_DIR)/conf/distributions
-endif
- for FILE in $(PACKAGES_DIR)/*.changes ; do \
- $(HOME_ARG) reprepro --ignore=wrongdistribution \
- -Vb $(REPO_DIR) include kitten $${FILE} ; \
- done
- reprepro -Vb $(REPO_DIR) createsymlinks
-else
-debian_apt_repository:
- @echo Not building APT repository as reprepro could not be found
-endif
diff --git a/packaging/debs/apt-repository/README b/packaging/debs/apt-repository/README
deleted file mode 100644
index 514a37f33e..0000000000
--- a/packaging/debs/apt-repository/README
+++ /dev/null
@@ -1,17 +0,0 @@
-APT repository for RabbitMQ
-
-Previously we've attempted to run a repository in the same way that
-Debian would: have repository management software installed on the
-server, and upload new packages to the repository as and when they're
-ready.
-
-This turned out to be both fiddly and annoying to do (and more
-particularly to automate) so since our repository is always going to be
-small it's easier just to create the entire repository as part of the
-build process, just like a package. It can then be moved into place as a
-single unit. The make target "debian_apt_repository" (invoked by "dist")
-will create it, and it can get moved onto the server with the rest of
-the packages.
-
-Read "README-real-repository" for information on how we used to do
-this.
diff --git a/packaging/debs/apt-repository/README-real-repository b/packaging/debs/apt-repository/README-real-repository
deleted file mode 100644
index 189852eb60..0000000000
--- a/packaging/debs/apt-repository/README-real-repository
+++ /dev/null
@@ -1,130 +0,0 @@
-APT Repository for RabbitMQ in Debian
-=====================================
-
-First, a note on what we're trying to do. We want a single "testing"
-repository. When RabbitMQ is more stable we will also want a
-"stable" repository. It is very important to understand that these refer
-to the state of the rabbit code, *NOT* which Debian distribution they go
-with. At the moment our dependencies are very simple so our packages can
-be used with any current Debian version (etch, lenny, sid) as well as
-with Ubuntu. So although we have a "testing" distribution, this is not
-codenamed "lenny". Instead it's currently codenamed "kitten" since
-that's a baby rabbit.
-
-Secondly, a note on software. We need a tool to manage the repository,
-and a tool to perform uploads to the repository. Debian being Debian
-there are quite a few of each. We will use "reprepro" to manage the
-repository since it's modern, maintained, and fairly simple. We will use
-"dupload" to perform the uploads since it gives us the ability to run
-arbitrary commands after the upload, which means we don't need to run a
-cron job on the web server to process uploads.
-
-Creating a repository
-=====================
-
-Much of this was cribbed from:
-http://www.debian-administration.org/articles/286
-
-The repository is fundamentally just some files in a folder, served over
-HTTP (or FTP etc). So let's make it "debian" in the root of
-www.rabbitmq.com.
-
-This means the repository will be at http://www.rabbitmq.com/debian/ and
-can be added to a sources.list as:
-
-deb http://www.rabbitmq.com/debian/ testing main
-deb-src http://www.rabbitmq.com/debian/ testing main
-
-Inside this folder we need a "conf" folder, and in
-that we need a "distributions" configuration file - see the file in this
-folder. Note that:
-
-* We list all architectures so that people can install rabbitmq-server
- on to anything.
-* We don't list the "all" architecture even though we use it; it's
- implied.
-* We only have a "main" component, we could have non-free and contrib
- here if it was relevant.
-* We list the email address associated with the key we want to use to
- sign the repository. Yes, even after signing packages we still want to
- sign the repository.
-
-We're now ready to go. Assuming the path to our repository is /path,
-(and hence configuration is in /path/conf) we can upload a file to the
-repository (creating it in the process) by doing something like this on
-the repository host:
-
-$ reprepro --ignore=wrongdistribution -Vb /path include kitten \
- rabbitmq-server_1.0.0-alpha-1_i386.changes
-
-Note that we upload to the distribution "kitten" rather than "testing".
-We also pass --ignore=wrongdistribution since the current packages are
-built to go in "unstable" (this will be changed obviously).
-
-Note also that the .changes file claims to be for i386 even though the
-package is for architecture "all". This is a bug in debhelper.
-
-Finally, if you've just created a repository, you want to run:
-
-$ reprepro -Vb /path createsymlinks
-
-since this will create "kitten" -> "testing" symlinks. You only need to
-do this once.
-
-Removing packages
-=================
-
-Fairly simple:
-
-$ reprepro --ignore=wrongdistribution -Vb /path remove kitten \
- rabbitmq-server
-
-Subsequent updates and "dupload"
-================================
-
-You can run the "reprepro" command above again to update the versions of
-software in the repository. Since we probably don't want to have to log
-into the machine in question to do this, we can use "dupload". This is a
-tool which uploads Debian packages. The supplied file "dupload.conf" can
-be renamed to ~/.dupload.conf. If you then run:
-
-$ dupload -to rabbit --nomail .
-
-in the folder with the .changes file, dupload will:
-
-* create an incoming folder in your home directory on the repository
-machine
-* upload everything there
-* run reprepro to move the packages into the repository
-* "rm -rf" the uploads folder
-
-This is a bit cheesy but should be enough for our purposes. The
-dupload.conf uses scp and ssh so you need a public-key login (or type
-your password lots).
-
-There's still an open question as to whether dupload is really needed
-for our case.
-
-Keys and signing
-================
-
-We currently sign the package as we build it; but we also need to sign
-the repository. The key is currently on my machine (mrforgetful) and has
-ID 056E8E56. We should put it on CDs though.
-
-reprepro will automatically sign the repository if we have the right
-SignWith line in the configuration, AND the secret key is installed on
-the repository server. This is obviously not ideal; not sure what the
-solution is right now.
-
-You can export the public key with:
-
-$ gpg --export --armor 056E8E56 > rabbit.pub
-
-(Open question: do we want to get our key on subkeys.pgp.net?)
-
-We can then add this key to the website and tell our users to import the
-key into apt with:
-
-# apt-key add rabbit.pub
-
diff --git a/packaging/debs/apt-repository/distributions b/packaging/debs/apt-repository/distributions
deleted file mode 100644
index 75b9fe4670..0000000000
--- a/packaging/debs/apt-repository/distributions
+++ /dev/null
@@ -1,7 +0,0 @@
-Origin: RabbitMQ
-Label: RabbitMQ Repository for Debian / Ubuntu etc
-Suite: testing
-Codename: kitten
-Architectures: AVR32 alpha amd64 arm armel armhf hppa hurd-i386 i386 ia64 kfreebsd-amd64 kfreebsd-i386 m32 m68k mips mipsel netbsd-alpha netbsd-i386 powerpc s390 s390x sh sparc source
-Components: main
-Description: RabbitMQ Repository for Debian / Ubuntu etc
diff --git a/packaging/debs/apt-repository/dupload.conf b/packaging/debs/apt-repository/dupload.conf
deleted file mode 100644
index 9ceed76000..0000000000
--- a/packaging/debs/apt-repository/dupload.conf
+++ /dev/null
@@ -1,16 +0,0 @@
-package config;
-
-$rabbit_user = "simon";
-$rabbit_host = "mrforgetful.lshift.net";
-$rabbit_repo_path = "/srv/debian";
-$rabbit_reprepro_extra_args = "--ignore=wrongdistribution";
-
-$cfg{'rabbit'} = {
- fqdn => "$rabbit_host",
- login => "$rabbit_user",
- method => "scp",
- incoming => "incoming",
-};
-
-$preupload{'deb'} = "ssh ${rabbit_host} mkdir incoming";
-$postupload{'deb'} = "ssh ${rabbit_host} \"cd incoming && reprepro ${$rabbit_reprepro_extra_args} -Vb ${rabbit_repo_path} include kitten *.changes && cd .. && rm -r incoming\"";
diff --git a/packaging/generic-unix/Makefile b/packaging/generic-unix/Makefile
deleted file mode 100644
index 66aeff9071..0000000000
--- a/packaging/generic-unix/Makefile
+++ /dev/null
@@ -1,58 +0,0 @@
-SOURCE_DIST_FILE ?= $(wildcard ../../../rabbitmq-server-*.tar.xz)
-
-ifneq ($(filter-out clean,$(MAKECMDGOALS)),)
-ifeq ($(SOURCE_DIST_FILE),)
-$(error Cannot find source archive; please specify SOURCE_DIST_FILE)
-endif
-ifneq ($(words $(SOURCE_DIST_FILE)),1)
-$(error Multile source archives found; please specify SOURCE_DIST_FILE)
-endif
-
-VERSION ?= $(patsubst rabbitmq-server-%.tar.xz,%,$(notdir $(SOURCE_DIST_FILE)))
-ifeq ($(VERSION),)
-$(error Cannot determine version; please specify VERSION)
-endif
-endif
-
-SOURCE_DIR = rabbitmq-server-$(VERSION)
-TARGET_DIR = rabbitmq_server-$(VERSION)
-TARGET_TARBALL = rabbitmq-server-generic-unix-$(VERSION)
-
-unexport DEPS_DIR
-unexport ERL_LIBS
-
-all: dist
- @:
-
-dist:
- xzcat $(SOURCE_DIST_FILE) | tar -xf -
-
-# web-manpages are not used by generic-unix but by `make release` in the.
-# Umbrella. Those manpages are copied to www.rabbitmq.com
- $(MAKE) -C $(SOURCE_DIR) \
- PREFIX= RMQ_ROOTDIR= \
- RMQ_ERLAPP_DIR=`pwd`/$(TARGET_DIR) \
- MANDIR=`pwd`/$(TARGET_DIR)/share/man \
- manpages web-manpages install install-man
-
- sed -e 's:^SYS_PREFIX=$$:SYS_PREFIX=\$${RABBITMQ_HOME}:' \
- $(TARGET_DIR)/sbin/rabbitmq-defaults >$(TARGET_DIR)/sbin/rabbitmq-defaults.tmp \
- && mv $(TARGET_DIR)/sbin/rabbitmq-defaults.tmp $(TARGET_DIR)/sbin/rabbitmq-defaults
- chmod 0755 $(TARGET_DIR)/sbin/rabbitmq-defaults
-
- mkdir -p $(TARGET_DIR)/etc/rabbitmq
-
- find $(TARGET_DIR) -print0 | LC_COLLATE=C sort -z | \
- xargs -0 tar --no-recursion -cf - | \
- xz > $(CURDIR)/$(TARGET_TARBALL).tar.xz
-
- if test "$(PACKAGES_DIR)"; then \
- mkdir -p "$(PACKAGES_DIR)"; \
- mv $(TARGET_TARBALL).tar.xz "$(PACKAGES_DIR)"; \
- fi
-
-clean: clean_partial
- rm -f rabbitmq-server-generic-unix-*.tar.xz
-
-clean_partial:
- rm -rf rabbitmq-server-* rabbitmq_server-*
diff --git a/packaging/standalone/Makefile b/packaging/standalone/Makefile
deleted file mode 100644
index aa8660ce38..0000000000
--- a/packaging/standalone/Makefile
+++ /dev/null
@@ -1,123 +0,0 @@
-SOURCE_DIST_FILE ?= $(wildcard ../../rabbitmq-server-*.tar.xz)
-
-ifneq ($(filter-out clean,$(MAKECMDGOALS)),)
-ifeq ($(SOURCE_DIST_FILE),)
-$(error Cannot find source archive; please specify SOURCE_DIST_FILE)
-endif
-ifneq ($(words $(SOURCE_DIST_FILE)),1)
-$(error Multile source archives found; please specify SOURCE_DIST_FILE)
-endif
-
-VERSION ?= $(patsubst rabbitmq-server-%.tar.xz,%,$(notdir $(SOURCE_DIST_FILE)))
-ifeq ($(VERSION),)
-$(error Cannot determine version; please specify VERSION)
-endif
-endif
-
-SOURCE_DIR=rabbitmq-server-$(VERSION)
-TARGET_DIR=rabbitmq_server-$(VERSION)
-TARGET_TARBALL=rabbitmq-server-$(OS)-standalone-$(VERSION)
-RLS_DIR=$(TARGET_DIR)/release/$(TARGET_DIR)
-
-ERTS_VSN=$(shell erl -noshell -eval 'io:format("~s", [erlang:system_info(version)]), halt().')
-ERTS_ROOT_DIR=$(shell erl -noshell -eval 'io:format("~s", [code:root_dir()]), halt().')
-OTP_RELEASE=$(shell erl -noshell -eval 'io:format("~s", [erlang:system_info(otp_release)]), halt().')
-
-# used to generate the erlang release
-RABBITMQ_HOME=$(TARGET_DIR)
-RABBITMQ_EBIN_ROOT=$(RABBITMQ_HOME)/ebin
-RABBITMQ_PLUGINS_DIR=$(RABBITMQ_HOME)/plugins
-RABBITMQ_PLUGINS_EXPAND_DIR=$(RABBITMQ_PLUGINS_DIR)/expand
-
-RABBITMQ_DEFAULTS=$(TARGET_DIR)/sbin/rabbitmq-defaults
-fix_defaults = sed -e $(1) $(RABBITMQ_DEFAULTS) > $(RABBITMQ_DEFAULTS).tmp \
- && mv $(RABBITMQ_DEFAULTS).tmp $(RABBITMQ_DEFAULTS)
-
-unexport DEPS_DIR
-unexport ERL_LIBS
-
-all: dist
- @:
-
-dist:
- rm -rf $(SOURCE_DIR) $(TARGET_DIR)
- xzcat $(SOURCE_DIST_FILE) | tar -xf -
-
- $(MAKE) -C $(SOURCE_DIR) \
- PREFIX= RMQ_ROOTDIR= \
- RMQ_ERLAPP_DIR=$(abspath $(TARGET_DIR)) \
- MANDIR=$(abspath $(TARGET_DIR))/share/man \
- manpages install install-man
-
- mkdir -p $(TARGET_DIR)/etc/rabbitmq
- cp $(SOURCE_DIR)/docs/rabbitmq.config.example $(TARGET_DIR)/etc/rabbitmq
-
-## Here we set the RABBITMQ_HOME variable,
-## then we make ERL_DIR point to our released erl
-## and we add the paths to our released start_clean and start_sasl boot scripts
- $(call fix_defaults,'s:^SYS_PREFIX=$$:SYS_PREFIX=\$${RABBITMQ_HOME}:')
- $(call fix_defaults,'s:^ERL_DIR=$$:ERL_DIR=\$${RABBITMQ_HOME}/erts-$(ERTS_VSN)/bin/:')
- $(call fix_defaults,'s:start_clean$$:"\$${SYS_PREFIX}/releases/$(VERSION)/start_clean":')
- $(call fix_defaults,'s:start_sasl:"\$${SYS_PREFIX}/releases/$(VERSION)/start_sasl":')
-
- chmod 0755 $(RABBITMQ_DEFAULTS)
-
- mkdir -p $(TARGET_DIR)/etc/rabbitmq
-
- $(MAKE) generate_release
-
- mkdir -p $(RLS_DIR)
- tar -C $(RLS_DIR) -xzf $(RABBITMQ_HOME)/rabbit.tar.gz
-
-# add minimal boot file
- cp $(ERTS_ROOT_DIR)/bin/start_clean.boot $(RLS_DIR)/releases/$(VERSION)
- cp $(ERTS_ROOT_DIR)/bin/start_sasl.boot $(RLS_DIR)/releases/$(VERSION)
-
-# add OTP_VERSION file
- mkdir -p $(RLS_DIR)/releases/$(OTP_RELEASE)
- cp $(ERTS_ROOT_DIR)/releases/$(OTP_RELEASE)/OTP_VERSION $(RLS_DIR)/releases/$(OTP_RELEASE)/OTP_VERSION
-
-# copy start.boot to bin folder as Erlang does.
-# Required by rabbit_nodes:ensure_epmd/0
- mkdir -p $(RLS_DIR)/bin/
- cp $(ERTS_ROOT_DIR)/bin/start.boot $(RLS_DIR)/bin/
-
-# move rabbitmq files to top level folder
- mv $(RLS_DIR)/lib/rabbit-$(VERSION)/* $(RLS_DIR)
-
-# remove empty lib/rabbit-$(VERSION) folder
- rm -rf $(RLS_DIR)/lib/rabbit-$(VERSION)
-
-# fix Erlang ROOTDIR
- patch -o $(RLS_DIR)/erts-$(ERTS_VSN)/bin/erl $(RLS_DIR)/erts-$(ERTS_VSN)/bin/erl.src < erl.diff
- rm -f $(RLS_DIR)/erts-$(ERTS_VSN)/bin/erl.orig
-
- cd $(TARGET_DIR)/release && \
- find $(TARGET_DIR) -print0 | LC_COLLATE=C sort -z | \
- xargs -0 tar --no-recursion -cf - | \
- xz > $(CURDIR)/$(TARGET_TARBALL).tar.xz
-
- if test "$(PACKAGES_DIR)"; then \
- mkdir -p "$(PACKAGES_DIR)"; \
- mv $(TARGET_TARBALL).tar.xz "$(PACKAGES_DIR)"; \
- fi
-
-clean:
- rm -rf rabbitmq-server-* rabbitmq_server-*
-
-.PHONY : generate_release
-generate_release:
- erlc \
- -I $(TARGET_DIR)/include/ -o src -Wall \
- -v +debug_info -Duse_proper_qc \
- -pa $(TARGET_DIR)/ebin/ src/rabbit_release.erl
- ERL_LIBS="$(TARGET_DIR)/plugins:$$ERL_LIBS" \
- erl \
- -pa "$(RABBITMQ_EBIN_ROOT)" \
- -pa src \
- -noinput \
- -hidden \
- -s rabbit_release \
- -extra "$(RABBITMQ_PLUGINS_DIR)" "$(RABBITMQ_PLUGINS_EXPAND_DIR)" "$(RABBITMQ_HOME)"
- test -f $(RABBITMQ_HOME)/rabbit.tar.gz
- rm src/rabbit_release.beam
diff --git a/packaging/standalone/erl.diff b/packaging/standalone/erl.diff
deleted file mode 100644
index 13b7d328d6..0000000000
--- a/packaging/standalone/erl.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-21c21
-< ROOTDIR="%FINAL_ROOTDIR%"
----
-> ROOTDIR="$(cd $(dirname "$0") && pwd)/../.."
diff --git a/packaging/standalone/src/rabbit_release.erl b/packaging/standalone/src/rabbit_release.erl
deleted file mode 100644
index 9eed1a59fa..0000000000
--- a/packaging/standalone/src/rabbit_release.erl
+++ /dev/null
@@ -1,160 +0,0 @@
-%% The contents of this file are subject to the Mozilla Public License
-%% Version 1.1 (the "License"); you may not use this file except in
-%% compliance with the License. You may obtain a copy of the License
-%% at http://www.mozilla.org/MPL/
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and
-%% limitations under the License.
-%%
-%% The Original Code is RabbitMQ.
-%%
-%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2012 GoPivotal, Inc. All rights reserved.
-%%
--module(rabbit_release).
-
--export([start/0]).
-
--include("rabbit.hrl").
-
--define(BaseApps, [rabbit]).
--define(ERROR_CODE, 1).
-
-%% We need to calculate all the ERTS apps we need to ship with a
-%% standalone rabbit. To acomplish that we need to unpack and load the plugins
-%% apps that are shiped with rabbit.
-%% Once we get that we generate an erlang release inside a tarball.
-%% Our make file will work with that release to generate our final rabbitmq
-%% package.
-start() ->
- %% Determine our various directories
- [PluginsDistDir, UnpackedPluginDir, RabbitHome] =
- init:get_plain_arguments(),
- RootName = UnpackedPluginDir ++ "/rabbit",
-
- %% extract the plugins so we can load their apps later
- prepare_plugins(PluginsDistDir, UnpackedPluginDir),
-
- %% add the plugin ebin folder to the code path.
- add_plugins_to_path(UnpackedPluginDir),
-
- PluginAppNames = [P#plugin.name ||
- P <- rabbit_plugins:list(PluginsDistDir, false)],
-
- %% Build the entire set of dependencies - this will load the
- %% applications along the way
- AllApps = case catch sets:to_list(expand_dependencies(PluginAppNames)) of
- {failed_to_load_app, App, Err} ->
- terminate("failed to load application ~s:~n~p",
- [App, Err]);
- AppList ->
- AppList
- end,
-
- %% we need a list of ERTS apps we need to ship with rabbit
- RabbitMQAppNames = [rabbit | [P#plugin.name ||
- P <- rabbit_plugins:list(PluginsDistDir, true)]]
- -- PluginAppNames,
- {ok, SslAppsConfig} = application:get_env(rabbit, ssl_apps),
-
- BaseApps = lists:umerge([
- lists:sort(RabbitMQAppNames),
- lists:sort(SslAppsConfig),
- lists:sort(AllApps -- PluginAppNames)]),
-
- AppVersions = [determine_version(App) || App <- BaseApps],
- RabbitVersion = proplists:get_value(rabbit, AppVersions),
-
- %% Build the overall release descriptor
- RDesc = {release,
- {"rabbit", RabbitVersion},
- {erts, erlang:system_info(version)},
- AppVersions},
-
- %% Write it out to $RABBITMQ_PLUGINS_EXPAND_DIR/rabbit.rel
- rabbit_file:write_file(RootName ++ ".rel", io_lib:format("~p.~n", [RDesc])),
-
- %% Compile the script
- systools:make_script(RootName),
- systools:script2boot(RootName),
- %% Make release tarfile
- make_tar(RootName, RabbitHome),
- rabbit_misc:quit(0).
-
-make_tar(Release, RabbitHome) ->
- systools:make_tar(Release,
- [
- {dirs, [docs, etc, include, plugins, sbin, share]},
- {erts, code:root_dir()},
- {outdir, RabbitHome}
- ]).
-
-determine_version(App) ->
- application:load(App),
- {ok, Vsn} = application:get_key(App, vsn),
- {App, Vsn}.
-
-delete_recursively(Fn) ->
- case rabbit_file:recursive_delete([Fn]) of
- ok -> ok;
- {error, {Path, E}} -> {error, {cannot_delete, Path, E}};
- Error -> Error
- end.
-
-prepare_plugins(PluginsDistDir, DestDir) ->
- %% Eliminate the contents of the destination directory
- case delete_recursively(DestDir) of
- ok -> ok;
- {error, E} -> terminate("Could not delete dir ~s (~p)", [DestDir, E])
- end,
- case filelib:ensure_dir(DestDir ++ "/") of
- ok -> ok;
- {error, E2} -> terminate("Could not create dir ~s (~p)", [DestDir, E2])
- end,
-
- [prepare_plugin(Plugin, DestDir) ||
- Plugin <- rabbit_plugins:list(PluginsDistDir, true)].
-
-prepare_plugin(#plugin{type = ez, location = Location}, PluginDestDir) ->
- zip:unzip(Location, [{cwd, PluginDestDir}]);
-prepare_plugin(#plugin{type = dir, name = Name, location = Location},
- PluginsDestDir) ->
- rabbit_file:recursive_copy(Location,
- filename:join([PluginsDestDir, Name])).
-
-expand_dependencies(Pending) ->
- expand_dependencies(sets:new(), Pending).
-expand_dependencies(Current, []) ->
- Current;
-expand_dependencies(Current, [Next|Rest]) ->
- case sets:is_element(Next, Current) of
- true ->
- expand_dependencies(Current, Rest);
- false ->
- case application:load(Next) of
- ok ->
- ok;
- {error, {already_loaded, _}} ->
- ok;
- {error, Reason} ->
- throw({failed_to_load_app, Next, Reason})
- end,
- {ok, Required} = application:get_key(Next, applications),
- Unique = [A || A <- Required, not(sets:is_element(A, Current))],
- expand_dependencies(sets:add_element(Next, Current), Rest ++ Unique)
- end.
-
-add_plugins_to_path(PluginDir) ->
- [add_plugin_to_path(PluginName) ||
- PluginName <- filelib:wildcard(PluginDir ++ "/*/ebin/*.app")].
-
-add_plugin_to_path(PluginAppDescFn) ->
- %% Add the plugin ebin directory to the load path
- PluginEBinDirN = filename:dirname(PluginAppDescFn),
- code:add_path(PluginEBinDirN).
-
-terminate(Fmt, Args) ->
- io:format("ERROR: " ++ Fmt ++ "~n", Args),
- rabbit_misc:quit(?ERROR_CODE).
diff --git a/packaging/windows-exe/Makefile b/packaging/windows-exe/Makefile
deleted file mode 100644
index 26ef4585c3..0000000000
--- a/packaging/windows-exe/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-ifeq ($(PACKAGES_DIR),)
-ZIP_DIR = ../windows
-else
-ZIP_DIR = $(PACKAGES_DIR)
-endif
-ZIP = $(notdir $(wildcard $(ZIP_DIR)/rabbitmq-server-windows-*.zip))
-
-VERSION = $(patsubst rabbitmq-server-windows-%.zip,%,$(ZIP))
-
-unexport DEPS_DIR
-unexport ERL_LIBS
-
-all: dist
- @:
-
-dist: rabbitmq-$(VERSION).nsi rabbitmq_server-$(VERSION)
- makensis -V2 rabbitmq-$(VERSION).nsi
-
- if test "$(PACKAGES_DIR)"; then \
- mkdir -p "$(PACKAGES_DIR)"; \
- mv rabbitmq-server-$(VERSION).exe "$(PACKAGES_DIR)"; \
- fi
-
-rabbitmq-$(VERSION).nsi: rabbitmq_nsi.in
- sed \
- -e 's|%%VERSION%%|$(VERSION)|' \
- $< > $@
-
-rabbitmq_server-$(VERSION):
- unzip -q $(ZIP_DIR)/$(ZIP)
-
-clean:
- rm -rf rabbitmq-*.nsi rabbitmq_server-* rabbitmq-server-*.exe
diff --git a/packaging/windows-exe/plugins/ExecDos.dll b/packaging/windows-exe/plugins/ExecDos.dll
deleted file mode 100644
index 0d8a871a9d..0000000000
--- a/packaging/windows-exe/plugins/ExecDos.dll
+++ /dev/null
Binary files differ
diff --git a/packaging/windows-exe/rabbitmq.ico b/packaging/windows-exe/rabbitmq.ico
deleted file mode 100644
index 5e169a7996..0000000000
--- a/packaging/windows-exe/rabbitmq.ico
+++ /dev/null
Binary files differ
diff --git a/packaging/windows-exe/rabbitmq_nsi.in b/packaging/windows-exe/rabbitmq_nsi.in
deleted file mode 100644
index 4c47e86628..0000000000
--- a/packaging/windows-exe/rabbitmq_nsi.in
+++ /dev/null
@@ -1,272 +0,0 @@
-; Use the "Modern" UI
-!include MUI2.nsh
-!include LogicLib.nsh
-!include WinMessages.nsh
-!include FileFunc.nsh
-!include WordFunc.nsh
-!include x64.nsh
-
-!addplugindir plugins
-
-!define env_hklm 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
-!define uninstall "Software\Microsoft\Windows\CurrentVersion\Uninstall\RabbitMQ"
-!define MUI_FINISHPAGE_NOAUTOCLOSE
-!define MUI_UNFINISHPAGE_NOAUTOCLOSE
-
-;--------------------------------
-
-; The name of the installer
-Name "RabbitMQ Server %%VERSION%%"
-
-; The file to write
-OutFile "rabbitmq-server-%%VERSION%%.exe"
-
-; Icons
-!define MUI_ICON "rabbitmq.ico"
-
-; The default installation directory is empty. The .onInit function
-; below takes care of selecting the appropriate (32-bit vs. 64-bit)
-; "Program Files".
-InstallDir ""
-
-; Registry key to check for directory (so if you install again, it will
-; overwrite the old one automatically)
-InstallDirRegKey HKLM "Software\VMware, Inc.\RabbitMQ Server" "Install_Dir"
-
-; Request application privileges for Windows Vista
-RequestExecutionLevel admin
-
-SetCompressor /solid lzma
-
-;--------------------------------
-
-; Pages
-
-
-; !insertmacro MUI_PAGE_LICENSE "..\..\LICENSE-MPL-RabbitMQ"
- !insertmacro MUI_PAGE_COMPONENTS
- !insertmacro MUI_PAGE_DIRECTORY
- !insertmacro MUI_PAGE_INSTFILES
- !insertmacro MUI_PAGE_FINISH
-
- !insertmacro MUI_UNPAGE_CONFIRM
- !insertmacro MUI_UNPAGE_INSTFILES
- !define MUI_FINISHPAGE_TEXT "RabbitMQ Server %%VERSION%% has been uninstalled from your computer.$\n$\nPlease note that the log and database directories located at $APPDATA\RabbitMQ have not been removed. You can remove them manually if desired."
- !insertmacro MUI_UNPAGE_FINISH
-
-;--------------------------------
-;Languages
-
- !insertmacro MUI_LANGUAGE "English"
-
-;--------------------------------
-
-VIProductVersion "%%VERSION%%.0"
-VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "%%VERSION%%"
-VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "RabbitMQ Server"
-;VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" ""
-VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Pivotal Software, Inc"
-;VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "" ; TODO ?
-VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright (c) 2007-2015 Pivotal Software, Inc. All rights reserved."
-VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "RabbitMQ Server"
-VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "%%VERSION%%"
-
-; The stuff to install
-Section "RabbitMQ Server (required)" Rabbit
-
- SectionIn RO
-
- ; Set output path to the installation directory.
- SetOutPath $INSTDIR
-
- ; Put files there
- File /r "rabbitmq_server-%%VERSION%%"
- File "rabbitmq.ico"
-
- ; Set output path to the user's data directory
- SetOutPath $APPDATA\RabbitMQ
-
- ; ...And put the example config file there
- File "rabbitmq_server-%%VERSION%%\etc\rabbitmq.config.example"
-
- ; Write the installation path into the registry
- WriteRegStr HKLM "SOFTWARE\VMware, Inc.\RabbitMQ Server" "Install_Dir" "$INSTDIR"
-
- ; Write the uninstall keys for Windows
- WriteRegStr HKLM ${uninstall} "DisplayName" "RabbitMQ Server %%VERSION%%"
- WriteRegStr HKLM ${uninstall} "UninstallString" "$INSTDIR\uninstall.exe"
- WriteRegStr HKLM ${uninstall} "DisplayIcon" "$INSTDIR\rabbitmq.ico"
- WriteRegStr HKLM ${uninstall} "Publisher" "Pivotal Software, Inc."
- WriteRegStr HKLM ${uninstall} "DisplayVersion" "%%VERSION%%"
- WriteRegDWORD HKLM ${uninstall} "NoModify" 1
- WriteRegDWORD HKLM ${uninstall} "NoRepair" 1
-
- ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
- IntFmt $0 "0x%08X" $0
- WriteRegDWORD HKLM "${uninstall}" "EstimatedSize" "$0"
-
- WriteUninstaller "uninstall.exe"
-SectionEnd
-
-;--------------------------------
-
-Section "RabbitMQ Service" RabbitService
- DetailPrint "Installing RabbitMQ service..."
- ExecDos::exec /DETAILED '"$INSTDIR\rabbitmq_server-%%VERSION%%\sbin\rabbitmq-service.bat" install' ""
- DetailPrint "Starting RabbitMQ service..."
- ExecDos::exec /DETAILED '"$INSTDIR\rabbitmq_server-%%VERSION%%\sbin\rabbitmq-service.bat" start' ""
- ReadEnvStr $1 "HOMEDRIVE"
- ReadEnvStr $2 "HOMEPATH"
- CopyFiles "$WINDIR\.erlang.cookie" "$1$2\.erlang.cookie"
-SectionEnd
-
-;--------------------------------
-
-Section "Start Menu" RabbitStartMenu
- ; In case the service is not installed, or the service installation fails,
- ; make sure these exist or Explorer will get confused.
- CreateDirectory "$APPDATA\RabbitMQ\log"
- CreateDirectory "$APPDATA\RabbitMQ\db"
-
- CreateDirectory "$SMPROGRAMS\RabbitMQ Server"
- CreateShortCut "$SMPROGRAMS\RabbitMQ Server\Uninstall RabbitMQ.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
- CreateShortCut "$SMPROGRAMS\RabbitMQ Server\RabbitMQ Plugins.lnk" "$INSTDIR\rabbitmq_server-%%VERSION%%\plugins"
- CreateShortCut "$SMPROGRAMS\RabbitMQ Server\RabbitMQ Logs.lnk" "$APPDATA\RabbitMQ\log"
- CreateShortCut "$SMPROGRAMS\RabbitMQ Server\RabbitMQ Database Directory.lnk" "$APPDATA\RabbitMQ\db"
- CreateShortCut "$SMPROGRAMS\RabbitMQ Server\RabbitMQ Service - (re)install.lnk" "$INSTDIR\rabbitmq_server-%%VERSION%%\sbin\rabbitmq-service.bat" "install" "$INSTDIR\rabbitmq.ico"
- CreateShortCut "$SMPROGRAMS\RabbitMQ Server\RabbitMQ Service - remove.lnk" "$INSTDIR\rabbitmq_server-%%VERSION%%\sbin\rabbitmq-service.bat" "remove" "$INSTDIR\rabbitmq.ico"
- CreateShortCut "$SMPROGRAMS\RabbitMQ Server\RabbitMQ Service - start.lnk" "$INSTDIR\rabbitmq_server-%%VERSION%%\sbin\rabbitmq-service.bat" "start" "$INSTDIR\rabbitmq.ico"
- CreateShortCut "$SMPROGRAMS\RabbitMQ Server\RabbitMQ Service - stop.lnk" "$INSTDIR\rabbitmq_server-%%VERSION%%\sbin\rabbitmq-service.bat" "stop" "$INSTDIR\rabbitmq.ico"
-
- SetOutPath "$INSTDIR\rabbitmq_server-%%VERSION%%\sbin"
- CreateShortCut "$SMPROGRAMS\RabbitMQ Server\RabbitMQ Command Prompt (sbin dir).lnk" "$WINDIR\system32\cmd.exe" "" "$WINDIR\system32\cmd.exe"
- SetOutPath $INSTDIR
-SectionEnd
-
-;--------------------------------
-
-; Section descriptions
-
-LangString DESC_Rabbit ${LANG_ENGLISH} "The RabbitMQ Server."
-LangString DESC_RabbitService ${LANG_ENGLISH} "Set up RabbitMQ as a Windows Service."
-LangString DESC_RabbitStartMenu ${LANG_ENGLISH} "Add some useful links to the start menu."
-
-!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
- !insertmacro MUI_DESCRIPTION_TEXT ${Rabbit} $(DESC_Rabbit)
- !insertmacro MUI_DESCRIPTION_TEXT ${RabbitService} $(DESC_RabbitService)
- !insertmacro MUI_DESCRIPTION_TEXT ${RabbitStartMenu} $(DESC_RabbitStartMenu)
-!insertmacro MUI_FUNCTION_DESCRIPTION_END
-
-;--------------------------------
-
-; Uninstaller
-
-Section "Uninstall"
-
- ; Remove registry keys
- DeleteRegKey HKLM ${uninstall}
- DeleteRegKey HKLM "SOFTWARE\VMware, Inc.\RabbitMQ Server"
-
- ; TODO these will fail if the service is not installed - do we care?
- DetailPrint "Stopping RabbitMQ service..."
- ExecDos::exec /DETAILED '"$INSTDIR\rabbitmq_server-%%VERSION%%\sbin\rabbitmq-service.bat" stop' ""
- DetailPrint "Removing RabbitMQ service..."
- ExecDos::exec /DETAILED '"$INSTDIR\rabbitmq_server-%%VERSION%%\sbin\rabbitmq-service.bat" remove' ""
-
- ; Remove files and uninstaller
- RMDir /r "$INSTDIR\rabbitmq_server-%%VERSION%%"
- Delete "$INSTDIR\rabbitmq.ico"
- Delete "$INSTDIR\uninstall.exe"
- RMDir "$INSTDIR"
-
- ; Remove start menu items
- RMDir /r "$SMPROGRAMS\RabbitMQ Server"
-
- DeleteRegValue ${env_hklm} ERLANG_HOME
- SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
-
-SectionEnd
-
-;--------------------------------
-
-; Functions
-
-Function .onInit
- ; By default, always install in "\Program Files", not matter if we run
- ; on a 32-bit or 64-bit Windows.
- ${If} $INSTDIR == "";
- ${If} ${RunningX64}
- StrCpy $INSTDIR "$PROGRAMFILES64\RabbitMQ Server"
- ${Else}
- StrCpy $INSTDIR "$PROGRAMFILES\RabbitMQ Server"
- ${EndIf}
- ${EndIf}
-
- Call findErlang
-
- ReadRegStr $0 HKLM ${uninstall} "UninstallString"
- ${If} $0 != ""
- MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "RabbitMQ is already installed. $\n$\nClick 'OK' to remove the previous version or 'Cancel' to cancel this installation." /SD IDOK IDOK rununinstall IDCANCEL norun
-
- norun:
- Abort
-
- rununinstall:
- ;Run the uninstaller
- ClearErrors
- ExecWait '"$INSTDIR\uninstall.exe" /S _?=$INSTDIR'
- Delete "$INSTDIR\uninstall.exe"
- RMDir "$INSTDIR"
- ; the unistaller removes the ERLANG_HOME.
- ; called again since this is an update
- Call findErlang
-
- ${EndIf}
-FunctionEnd
-
-Function findErlang
-
- StrCpy $0 0
- StrCpy $2 "not-found"
- ${Do}
- EnumRegKey $1 HKLM Software\Ericsson\Erlang $0
- ${If} $1 = ""
- ${Break}
- ${EndIf}
- ${If} $1 <> "ErlSrv"
- StrCpy $2 $1
- ${EndIf}
-
- IntOp $0 $0 + 1
- ${Loop}
-
- ${If} $2 = "not-found"
- MessageBox MB_YESNO|MB_ICONEXCLAMATION "Erlang could not be detected.$\nYou must install Erlang before installing RabbitMQ. Would you like the installer to open a browser window to the Erlang download site?" IDNO abort
- ExecShell "open" "http://www.erlang.org/download.html"
- abort:
- Abort
- ${Else}
- ${VersionCompare} $2 "5.7.4" $0
- ${VersionCompare} $2 "5.8.1" $1
-
- ${If} $0 = 2
- MessageBox MB_OK|MB_ICONEXCLAMATION "Your installed version of Erlang ($2) is too old. Please install a more recent version."
- Abort
- ${ElseIf} $1 = 2
- MessageBox MB_YESNO|MB_ICONEXCLAMATION "Your installed version of Erlang ($2) is comparatively old.$\nFor best results, please install a newer version.$\nDo you wish to continue?" IDYES no_abort
- Abort
- no_abort:
- ${EndIf}
-
- ReadRegStr $0 HKLM "Software\Ericsson\Erlang\$2" ""
-
- ; See http://nsis.sourceforge.net/Setting_Environment_Variables
- WriteRegExpandStr ${env_hklm} ERLANG_HOME $0
- SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
-
- ; On Windows XP changing the permanent environment does not change *our*
- ; environment, so do that as well.
- System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("ERLANG_HOME", "$0").r0'
- ${EndIf}
-
-FunctionEnd
diff --git a/packaging/windows/Makefile b/packaging/windows/Makefile
deleted file mode 100644
index 52b6531c3c..0000000000
--- a/packaging/windows/Makefile
+++ /dev/null
@@ -1,43 +0,0 @@
-SOURCE_DIST_FILE ?= $(wildcard ../../../rabbitmq-server-*.tar.xz)
-
-ifneq ($(filter-out clean,$(MAKECMDGOALS)),)
-ifeq ($(SOURCE_DIST_FILE),)
-$(error Cannot find source archive; please specify SOURCE_DIST_FILE)
-endif
-ifneq ($(words $(SOURCE_DIST_FILE)),1)
-$(error Multile source archives found; please specify SOURCE_DIST_FILE)
-endif
-
-VERSION ?= $(patsubst rabbitmq-server-%.tar.xz,%,$(notdir $(SOURCE_DIST_FILE)))
-ifeq ($(VERSION),)
-$(error Cannot determine version; please specify VERSION)
-endif
-endif
-
-SOURCE_DIR = rabbitmq-server-$(VERSION)
-TARGET_DIR = rabbitmq_server-$(VERSION)
-TARGET_ZIP = rabbitmq-server-windows-$(VERSION)
-
-unexport DEPS_DIR
-unexport ERL_LIBS
-
-all: dist
- @:
-
-dist:
- xzcat $(SOURCE_DIST_FILE) | tar -xf -
- $(MAKE) -C $(SOURCE_DIR) install-windows \
- DESTDIR=$(abspath $(TARGET_DIR)) \
- WINDOWS_PREFIX=
-
- cp -a README-etc $(TARGET_DIR)/etc/README.txt
-
- zip -q -r $(TARGET_ZIP).zip $(TARGET_DIR)
-
- if test "$(PACKAGES_DIR)"; then \
- mkdir -p "$(PACKAGES_DIR)"; \
- mv $(TARGET_ZIP).zip "$(PACKAGES_DIR)"; \
- fi
-
-clean:
- rm -rf rabbitmq-server-* rabbitmq_server-*
diff --git a/packaging/windows/README-etc b/packaging/windows/README-etc
deleted file mode 100644
index b431247c6b..0000000000
--- a/packaging/windows/README-etc
+++ /dev/null
@@ -1,7 +0,0 @@
-In this directory you can find an example configuration file for RabbitMQ.
-
-Note that this directory is *not* where the real RabbitMQ
-configuration lives. The default location for the real configuration
-file is %APPDATA%\RabbitMQ\rabbitmq.config.
-
-%APPDATA% usually expands to C:\Users\%USERNAME%\AppData\Roaming or similar.
diff --git a/scripts/rabbitmq-script-wrapper b/scripts/rabbitmq-script-wrapper
deleted file mode 100644
index 9623f01709..0000000000
--- a/scripts/rabbitmq-script-wrapper
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-## The contents of this file are subject to the Mozilla Public License
-## Version 1.1 (the "License"); you may not use this file except in
-## compliance with the License. You may obtain a copy of the License
-## at http://www.mozilla.org/MPL/
-##
-## Software distributed under the License is distributed on an "AS IS"
-## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-## the License for the specific language governing rights and
-## limitations under the License.
-##
-## The Original Code is RabbitMQ.
-##
-## The Initial Developer of the Original Code is GoPivotal, Inc.
-## Copyright (c) 2007-2015 Pivotal Software, Inc. All rights reserved.
-##
-
-for arg in "$@" ; do
- # Wrap each arg in single quotes and wrap single quotes in double quotes, so that they're passed through cleanly.
- arg=`printf %s "$arg" | sed -e "s#'#'\"'\"'#g"`
- CMDLINE="${CMDLINE} '${arg}'"
-done
-
-cd /var/lib/rabbitmq
-
-SCRIPT=`basename $0`
-
-if [ `id -u` = `id -u rabbitmq` -a "$SCRIPT" = "rabbitmq-server" ] ; then
- RABBITMQ_ENV=/usr/lib/rabbitmq/bin/rabbitmq-env
- RABBITMQ_SCRIPTS_DIR=$(dirname "$RABBITMQ_ENV")
- . "$RABBITMQ_ENV"
-
- exec /usr/lib/rabbitmq/bin/rabbitmq-server "$@" @STDOUT_STDERR_REDIRECTION@
-elif [ `id -u` = `id -u rabbitmq` -o "$SCRIPT" = "rabbitmq-plugins" ] ; then
- if [ -f $PWD/.erlang.cookie ] ; then
- export HOME=.
- fi
- exec /usr/lib/rabbitmq/bin/${SCRIPT} "$@"
-elif [ `id -u` = 0 ] ; then
- @SU_RABBITMQ_SH_C@ "/usr/lib/rabbitmq/bin/${SCRIPT} ${CMDLINE}"
-else
- /usr/lib/rabbitmq/bin/${SCRIPT}
- echo
- echo "Only root or rabbitmq should run ${SCRIPT}"
- echo
- exit 1
-fi
diff --git a/scripts/rabbitmq-server-ha.ocf b/scripts/rabbitmq-server-ha.ocf
deleted file mode 100755
index f2ba9a1519..0000000000
--- a/scripts/rabbitmq-server-ha.ocf
+++ /dev/null
@@ -1,2328 +0,0 @@
-#!/bin/sh
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# See usage() function below for more details ...
-#
-# Note that the script uses an external file to setup RabbitMQ policies
-# so make sure to create it from an example shipped with the package.
-#
-#######################################################################
-# Initialization:
-
-: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat}
-. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
-
-#######################################################################
-
-# Fill in some defaults if no values are specified
-
-PATH=/sbin:/usr/sbin:/bin:/usr/bin
-
-OCF_RESKEY_binary_default="/usr/sbin/rabbitmq-server"
-OCF_RESKEY_ctl_default="/usr/sbin/rabbitmqctl"
-OCF_RESKEY_debug_default=false
-OCF_RESKEY_username_default="rabbitmq"
-OCF_RESKEY_groupname_default="rabbitmq"
-OCF_RESKEY_admin_user_default="guest"
-OCF_RESKEY_admin_password_default="guest"
-OCF_RESKEY_definitions_dump_file_default="/etc/rabbitmq/definitions"
-OCF_RESKEY_pid_file_default="/var/run/rabbitmq/pid"
-OCF_RESKEY_log_dir_default="/var/log/rabbitmq"
-OCF_RESKEY_mnesia_base_default="/var/lib/rabbitmq/mnesia"
-OCF_RESKEY_mnesia_schema_base_default="/var/lib/rabbitmq"
-OCF_RESKEY_host_ip_default="127.0.0.1"
-OCF_RESKEY_node_port_default=5672
-OCF_RESKEY_erlang_cookie_default=false
-OCF_RESKEY_erlang_cookie_file_default="/var/lib/rabbitmq/.erlang.cookie"
-OCF_RESKEY_use_fqdn_default=false
-OCF_RESKEY_fqdn_prefix_default=""
-OCF_RESKEY_max_rabbitmqctl_timeouts_default=3
-OCF_RESKEY_policy_file_default="/usr/local/sbin/set_rabbitmq_policy"
-OCF_RESKEY_rmq_feature_health_check_default=true
-OCF_RESKEY_rmq_feature_local_list_queues_default=true
-
-: ${HA_LOGTAG="lrmd"}
-: ${HA_LOGFACILITY="daemon"}
-: ${OCF_RESKEY_binary=${OCF_RESKEY_binary_default}}
-: ${OCF_RESKEY_ctl=${OCF_RESKEY_ctl_default}}
-: ${OCF_RESKEY_debug=${OCF_RESKEY_debug_default}}
-: ${OCF_RESKEY_username=${OCF_RESKEY_username_default}}
-: ${OCF_RESKEY_groupname=${OCF_RESKEY_groupname_default}}
-: ${OCF_RESKEY_admin_user=${OCF_RESKEY_admin_user_default}}
-: ${OCF_RESKEY_admin_password=${OCF_RESKEY_admin_password_default}}
-: ${OCF_RESKEY_definitions_dump_file=${OCF_RESKEY_definitions_dump_file_default}}
-: ${OCF_RESKEY_log_dir=${OCF_RESKEY_log_dir_default}}
-: ${OCF_RESKEY_mnesia_base=${OCF_RESKEY_mnesia_base_default}}
-: ${OCF_RESKEY_mnesia_schema_base=${OCF_RESKEY_mnesia_schema_base_default}}
-: ${OCF_RESKEY_pid_file=${OCF_RESKEY_pid_file_default}}
-: ${OCF_RESKEY_node_port=${OCF_RESKEY_node_port_default}}
-: ${OCF_RESKEY_erlang_cookie=${OCF_RESKEY_erlang_cookie_default}}
-: ${OCF_RESKEY_erlang_cookie_file=${OCF_RESKEY_erlang_cookie_file_default}}
-: ${OCF_RESKEY_use_fqdn=${OCF_RESKEY_use_fqdn_default}}
-: ${OCF_RESKEY_fqdn_prefix=${OCF_RESKEY_fqdn_prefix_default}}
-: ${OCF_RESKEY_max_rabbitmqctl_timeouts=${OCF_RESKEY_max_rabbitmqctl_timeouts_default}}
-: ${OCF_RESKEY_policy_file=${OCF_RESKEY_policy_file_default}}
-: ${OCF_RESKEY_rmq_feature_health_check=${OCF_RESKEY_rmq_feature_health_check_default}}
-: ${OCF_RESKEY_rmq_feature_local_list_queues=${OCF_RESKEY_rmq_feature_local_list_queues_default}}
-
-#######################################################################
-
-OCF_RESKEY_start_time_default=$((OCF_RESKEY_CRM_meta_timeout / 6000 + 2))
-: ${OCF_RESKEY_start_time=${OCF_RESKEY_start_time_default}}
-OCF_RESKEY_stop_time_default=${OCF_RESKEY_start_time_default}
-: ${OCF_RESKEY_stop_time=${OCF_RESKEY_start_time_default}}
-OCF_RESKEY_command_timeout_default=""
-: ${OCF_RESKEY_command_timeout=${OCF_RESKEY_command_timeout_default}}
-TIMEOUT_ARG=$((OCF_RESKEY_CRM_meta_timeout / 6000 + 30))
-COMMAND_TIMEOUT="/usr/bin/timeout ${OCF_RESKEY_command_timeout} ${TIMEOUT_ARG}"
-
-#######################################################################
-
-usage() {
- cat <<UEND
- usage: $0 (start|stop|validate-all|meta-data|status|monitor)
-
- $0 manages an ${OCF_RESKEY_binary} process as an HA resource
-
- The 'start' operation starts the networking service.
- The 'stop' operation stops the networking service.
- The 'validate-all' operation reports whether the parameters are valid
- The 'meta-data' operation reports this RA's meta-data information
- The 'status' operation reports whether the networking service is running
- The 'monitor' operation reports whether the networking service seems to be working
-
-UEND
-}
-
-meta_data() {
- # The EXTENDED_OCF_PARAMS parameter below does not exist by default
- # and hence converted to an empty string unless overridden. It
- # could be used by an extention script to add new parameters. For
- # example see https://review.openstack.org/#/c/249180/10
-
- cat <<END
-<?xml version="1.0"?>
-<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
-<resource-agent name="${OCF_RESKEY_binary}">
-<version>1.0</version>
-
-<longdesc lang="en">
-Resource agent for ${OCF_RESKEY_binary}
-</longdesc>
-<shortdesc lang="en">Resource agent for ${OCF_RESKEY_binary}</shortdesc>
-<parameters>
-
-<parameter name="binary" unique="0" required="0">
-<longdesc lang="en">
-RabbitMQ binary
-</longdesc>
-<shortdesc lang="en">RabbitMQ binary</shortdesc>
-<content type="string" default="${OCF_RESKEY_binary_default}" />
-</parameter>
-
-<parameter name="ctl" unique="0" required="0">
-<longdesc lang="en">
-rabbitctl binary
-</longdesc>
-<shortdesc lang="en">rabbitctl binary binary</shortdesc>
-<content type="string" default="${OCF_RESKEY_ctl_default}" />
-</parameter>
-
-<parameter name="pid_file" unique="0" required="0">
-<longdesc lang="en">
-RabbitMQ PID file
-</longdesc>
-<shortdesc lang="en">RabbitMQ PID file</shortdesc>
-<content type="string" default="${OCF_RESKEY_pid_file_default}" />
-</parameter>
-
-<parameter name="log_dir" unique="0" required="0">
-<longdesc lang="en">
-RabbitMQ log directory
-</longdesc>
-<shortdesc lang="en">RabbitMQ log directory</shortdesc>
-<content type="string" default="${OCF_RESKEY_log_dir_default}" />
-</parameter>
-
-<parameter name="username" unique="0" required="0">
-<longdesc lang="en">
-RabbitMQ user name
-</longdesc>
-<shortdesc lang="en">RabbitMQ user name</shortdesc>
-<content type="string" default="${OCF_RESKEY_username_default}" />
-</parameter>
-
-<parameter name="groupname" unique="0" required="0">
-<longdesc lang="en">
-RabbitMQ group name
-</longdesc>
-<shortdesc lang="en">RabbitMQ group name</shortdesc>
-<content type="string" default="${OCF_RESKEY_groupname_default}" />
-</parameter>
-
-<parameter name="admin_user" unique="0" required="0">
-<longdesc lang="en">
-RabbitMQ default admin user for API
-</longdesc>
-<shortdesc lang="en">RabbitMQ admin user</shortdesc>
-<content type="string" default="${OCF_RESKEY_admin_user_default}" />
-</parameter>
-
-<parameter name="admin_password" unique="0" required="0">
-<longdesc lang="en">
-RabbitMQ default admin user password for API
-</longdesc>
-<shortdesc lang="en">RabbitMQ admin password</shortdesc>
-<content type="string" default="${OCF_RESKEY_admin_password_default}" />
-</parameter>
-
-<parameter name="definitions_dump_file" unique="0" required="0">
-<longdesc lang="en">
-RabbitMQ default definitions dump file
-</longdesc>
-<shortdesc lang="en">RabbitMQ definitions dump file</shortdesc>
-<content type="string" default="${OCF_RESKEY_definitions_dump_file}" />
-</parameter>
-
-<parameter name="command_timeout" unique="0" required="0">
-<longdesc lang="en">
-Timeout command arguments for issued commands termination (value is auto evaluated)
-</longdesc>
-<shortdesc lang="en">Arguments for timeout wrapping command</shortdesc>
-<content type="string" default="${OCF_RESKEY_command_timeout_default}" />
-</parameter>
-
-<parameter name="start_time" unique="0" required="0">
-<longdesc lang="en">
-Timeout for start rabbitmq server
-</longdesc>
-<shortdesc lang="en">Timeout for start rabbitmq server</shortdesc>
-<content type="string" default="${OCF_RESKEY_start_time_default}" />
-</parameter>
-
-<parameter name="stop_time" unique="0" required="0">
-<longdesc lang="en">
-Timeout for stopping rabbitmq server
-</longdesc>
-<shortdesc lang="en">Timeout for stopping rabbitmq server</shortdesc>
-<content type="string" default="${OCF_RESKEY_stop_time_default}" />
-</parameter>
-
-<parameter name="debug" unique="0" required="0">
-<longdesc lang="en">
-The debug flag for agent (${OCF_RESKEY_binary}) instance.
-In the /tmp/ directory will be created rmq-* files for log
-some operations and ENV values inside OCF-script.
-</longdesc>
-<shortdesc lang="en">AMQP server (${OCF_RESKEY_binary}) debug flag</shortdesc>
-<content type="boolean" default="${OCF_RESKEY_debug_default}" />
-</parameter>
-
-<parameter name="mnesia_base" unique="0" required="0">
-<longdesc lang="en">
-Base directory for storing Mnesia files
-</longdesc>
-<shortdesc lang="en">Base directory for storing Mnesia files</shortdesc>
-<content type="boolean" default="${OCF_RESKEY_mnesia_base_default}" />
-</parameter>
-
-<parameter name="mnesia_schema_base" unique="0" required="0">
-<longdesc lang="en">
-Parent directory for Mnesia schema directory
-</longdesc>
-<shortdesc lang="en">Parent directory for Mnesia schema directory</shortdesc>
-<content type="string" default="${OCF_RESKEY_mnesia_schema_base_default}" />
-</parameter>
-
-<parameter name="host_ip" unique="0" required="0">
-<longdesc lang="en">
-${OCF_RESKEY_binary} should listen on this IP address
-</longdesc>
-<shortdesc lang="en">${OCF_RESKEY_binary} should listen on this IP address</shortdesc>
-<content type="boolean" default="${OCF_RESKEY_host_ip_default}" />
-</parameter>
-
-<parameter name="node_port" unique="0" required="0">
-<longdesc lang="en">
-${OCF_RESKEY_binary} should listen on this port
-</longdesc>
-<shortdesc lang="en">${OCF_RESKEY_binary} should listen on this port</shortdesc>
-<content type="boolean" default="${OCF_RESKEY_node_port_default}" />
-</parameter>
-
-<parameter name="erlang_cookie" unique="0" required="0">
-<longdesc lang="en">
-Erlang cookie for clustering. If specified, will be updated at the mnesia reset
-</longdesc>
-<shortdesc lang="en">Erlang cookie</shortdesc>
-<content type="boolean" default="${OCF_RESKEY_erlang_cookie_default}" />
-</parameter>
-
-<parameter name="erlang_cookie_file" unique="0" required="0">
-<longdesc lang="en">
-Erlang cookie file path where the cookie will be put, if requested
-</longdesc>
-<shortdesc lang="en">Erlang cookie file</shortdesc>
-<content type="boolean" default="${OCF_RESKEY_erlang_cookie_file_default}" />
-</parameter>
-
-<parameter name="use_fqdn" unique="0" required="0">
-<longdesc lang="en">
-Either to use FQDN or a shortname for the rabbitmq node
-</longdesc>
-<shortdesc lang="en">Use FQDN</shortdesc>
-<content type="boolean" default="${OCF_RESKEY_use_fqdn_default}" />
-</parameter>
-
-<parameter name="fqdn_prefix" unique="0" required="0">
-<longdesc lang="en">
-Optional FQDN prefix for RabbitMQ nodes in cluster.
-FQDN prefix can be specified to host multiple RabbitMQ instances on a node or
-in case of RabbitMQ running in dedicated network/interface.
-</longdesc>
-<shortdesc lang="en">FQDN prefix</shortdesc>
-<content type="string" default="${OCF_RESKEY_fqdn_prefix_default}" />
-</parameter>
-
-<parameter name="max_rabbitmqctl_timeouts" unique="0" required="0">
-<longdesc lang="en">
-If during monitor call rabbitmqctl times out, the timeout is ignored
-unless it is Nth timeout in a row. Here N is the value of the current parameter.
-If too many timeouts happen in a raw, the monitor call will return with error.
-</longdesc>
-<shortdesc lang="en">Fail only if that many rabbitmqctl timeouts in a row occurred</shortdesc>
-<content type="string" default="${OCF_RESKEY_max_rabbitmqctl_timeouts_default}" />
-</parameter>
-
-<parameter name="policy_file" unique="0" required="0">
-<longdesc lang="en">
-A path to the shell script to setup RabbitMQ policies
-</longdesc>
-<shortdesc lang="en">A policy file path</shortdesc>
-<content type="string" default="${OCF_RESKEY_policy_file_default}" />
-</parameter>
-
-<parameter name="rmq_feature_health_check" unique="0" required="0">
-<longdesc lang="en">
-Since rabbit 3.6.4 list_queues/list_channels-based monitoring should
-be replaced with "node_health_check" command, as it creates no network
-load at all.
-</longdesc>
-<shortdesc lang="en">Use node_health_check for monitoring</shortdesc>
-<content type="boolean" default="${OCF_RESKEY_rmq_feature_health_check_default}" />
-</parameter>
-
-<parameter name="rmq_feature_local_list_queues" unique="0" required="0">
-<longdesc lang="en">
-For rabbit version that implements --local flag for list_queues, this
-can greatly reduce network overhead in cases when node is
-stopped/demoted.
-</longdesc>
-<shortdesc lang="en">Use --local option for list_queues</shortdesc>
-<content type="boolean" default="${OCF_RESKEY_rmq_feature_local_list_queues_default}" />
-</parameter>
-
-$EXTENDED_OCF_PARAMS
-
-</parameters>
-
-<actions>
-<action name="start" timeout="20" />
-<action name="stop" timeout="20" />
-<action name="status" timeout="20" />
-<action name="monitor" depth="0" timeout="30" interval="5" />
-<action name="monitor" depth="0" timeout="30" interval="3" role="Master"/>
-<action name="promote" timeout="30" />
-<action name="demote" timeout="30" />
-<action name="notify" timeout="20" />
-<action name="validate-all" timeout="5" />
-<action name="meta-data" timeout="5" />
-</actions>
-</resource-agent>
-END
-}
-
-
-MIN_MASTER_SCORE=100
-BEST_MASTER_SCORE=1000
-
-
-#######################################################################
-# Functions invoked by resource manager actions
-
-#TODO(bogdando) move proc_kill, proc_stop to shared OCF functions
-# to be shipped with HA cluster packages
-###########################################################
-# Attempts to kill a process with retries and checks procfs
-# to make sure the process is stopped.
-#
-# Globals:
-# LL
-# Arguments:
-# $1 - pid of the process to try and kill
-# $2 - service name used for logging and match-based kill, if the pid is "none"
-# $3 - signal to use, defaults to SIGTERM
-# $4 - number of retries, defaults to 5
-# $5 - time to sleep between retries, defaults to 2
-# Returns:
-# 0 - if successful
-# 1 - if process is still running according to procfs
-# 2 - if invalid parameters passed in
-###########################################################
-proc_kill()
-{
- local pid="${1}"
- local service_name="${2}"
- local signal="${3:-SIGTERM}"
- local count="${4:-5}"
- local process_sleep="${5:-2}"
- local LH="${LL} proc_kill():"
- local pgrp="$(ps -o pgid= ${pid} 2>/dev/null | tr -d '[[:space:]]')"
-
- if [ "${pid}" -a "${pgrp}" = "1" ] ; then
- ocf_log err "${LH} shall not kill by the bad pid 1 (init)!"
- return 2
- fi
-
- if [ "${pid}" = "none" ]; then
- local matched
- matched="$(pgrep -fla ${service_name})"
- if [ -z "${matched}" ] ; then
- ocf_log err "${LH} cannot find any processes matching the ${service_name}!"
- return 2
- fi
- ocf_log debug "${LH} no pid provided, will try the ${service_name}, matched list: ${matched}"
- while [ $count -gt 0 ]; do
- if [ -z "${matched}" ]; then
- break
- else
- matched="$(pgrep -fla ${service_name})"
- ocf_log debug "${LH} Stopping ${service_name} with ${signal}..."
- ocf_run pkill -f -"${signal}" "${service_name}"
- fi
- sleep $process_sleep
- count=$(( count-1 ))
- done
- pgrep -f "${service_name}" > /dev/null
- if [ $? -ne 0 ] ; then
- ocf_log debug "${LH} Stopped ${service_name} with ${signal}"
- return 0
- else
- ocf_log warn "${LH} Failed to stop ${service_name} with ${signal}"
- return 1
- fi
- else
- # pid is not none
- while [ $count -gt 0 ]; do
- if [ ! -d "/proc/${pid}" ]; then
- break
- else
- ocf_log debug "${LH} Stopping ${service_name} with ${signal}..."
- ocf_run pkill -"${signal}" -g "${pgrp}"
- fi
- sleep $process_sleep
- count=$(( count-1 ))
- done
-
- # Check if the process ended after the last sleep
- if [ ! -d "/proc/${pid}" ] ; then
- ocf_log debug "${LH} Stopped ${service_name} with ${signal}"
- return 0
- fi
-
- ocf_log warn "${LH} Failed to stop ${service_name} with ${signal}"
- return 1
- fi
-}
-
-###########################################################
-# Attempts to kill a process with the given pid or pid file
-# using proc_kill and will retry with sigkill if sigterm is
-# unsuccessful.
-#
-# Globals:
-# OCF_ERR_GENERIC
-# OCF_SUCCESS
-# LL
-# Arguments:
-# $1 - pidfile or pid or 'none', if stopping by the name matching
-# $2 - service name used for logging or for the failback stopping method
-# $3 - stop process timeout (in sec), used to determine how many times we try
-# SIGTERM and an upper limit on how long this function should try and
-# stop the process. Defaults to 15.
-# Returns:
-# OCF_SUCCESS - if successful
-# OCF_ERR_GENERIC - if process is still running according to procfs
-###########################################################
-proc_stop()
-{
- local pid_param="${1}"
- local service_name="${2}"
- local timeout="${3:-15}"
- local LH="${LL} proc_stop():"
- local i
- local pid
- local pidfile
- if [ "${pid_param}" = "none" ] ; then
- pid="none"
- else
- # check if provide just a number
- echo "${pid_param}" | egrep -q '^[0-9]+$'
- if [ $? -eq 0 ]; then
- pid="${pid_param}"
- elif [ -e "${pid_param}" ]; then # check if passed in a pid file
- pidfile="${pid_param}"
- pid=$(cat "${pidfile}" 2>/dev/null | tr -s " " "\n" | sort -u)
- else
- ocf_log warn "${LH} pid param ${pid_param} is not a file or a number, try match by ${service_name}"
- pid="none"
- fi
- fi
- # number of times to try a SIGTEM is (timeout - 5 seconds) / 2 seconds
- local stop_count=$(( ($timeout-5)/2 ))
-
- # make sure we stop at least once
- if [ $stop_count -le 0 ]; then
- stop_count=1
- fi
-
- if [ -z "${pid}" ] ; then
- ocf_log warn "${LH} unable to get PID from ${pidfile}, try match by ${service_name}"
- pid="none"
- fi
-
- if [ -n "${pid}" ]; then
- for i in ${pid} ; do
- [ "${i}" ] || break
- ocf_log info "${LH} Stopping ${service_name} by PID ${i}"
- proc_kill "${i}" "${service_name}" SIGTERM $stop_count
- if [ $? -ne 0 ]; then
- # SIGTERM failed, send a single SIGKILL
- proc_kill "${i}" "${service_name}" SIGKILL 1 2
- if [ $? -ne 0 ]; then
- ocf_log err "${LH} ERROR: could not stop ${service_name}"
- return "${OCF_ERR_GENERIC}"
- fi
- fi
- done
- fi
-
- # Remove the pid file here which will remove empty pid files as well
- if [ -n "${pidfile}" ]; then
- rm -f "${pidfile}"
- fi
-
- ocf_log info "${LH} Stopped ${service_name}"
- return "${OCF_SUCCESS}"
-}
-
-# Invokes the given command as a rabbitmq user and wrapped in the
-# timeout command.
-su_rabbit_cmd() {
- local timeout
- if [ "$1" = "-t" ]; then
- timeout="/usr/bin/timeout ${OCF_RESKEY_command_timeout} $2"
- shift 2
- else
- timeout=$COMMAND_TIMEOUT
- fi
- local cmd="${1:-status}"
- local LH="${LL} su_rabbit_cmd():"
- local rc=1
- local user=$OCF_RESKEY_username
- local mail=/var/spool/mail/rabbitmq
- local pwd=/var/lib/rabbitmq
- local home=/var/lib/rabbitmq
-
- ocf_log debug "${LH} invoking a command: ${cmd}"
- su $user -s /bin/sh -c "USER=${user} MAIL=${mail} PWD=${pwd} HOME=${home} LOGNAME=${user} \
- ${timeout} ${cmd}"
- rc=$?
- ocf_log info "${LH} the invoked command exited ${rc}: ${cmd}"
- return $rc
-}
-
-now() {
- date -u +%s
-}
-
-master_score() {
- local LH="${LL} master_score():"
- local score=$1
- if [ -z $score ] ; then
- score=0
- fi
- ocf_log info "${LH} Updating master score attribute with ${score}"
- ocf_run crm_master -l reboot -v $score || return $OCF_ERR_GENERIC
- return $OCF_SUCCESS
-}
-
-# Return either FQDN or shortname, depends on the OCF_RESKEY_use_fqdn.
-get_hostname() {
- if [ "${OCF_RESKEY_use_fqdn}" = 'false' ] ; then
- echo "$(hostname -s)"
- else
- echo "$(hostname -f)"
- fi
-}
-
-# Strip the FQDN to the shortname, if OCF_RESKEY_use_fqdn was set;
-# Prepend prefix to the hostname
-process_fqdn() {
- if [ "${OCF_RESKEY_use_fqdn}" = 'false' ] ; then
- echo "${OCF_RESKEY_fqdn_prefix}$1" | awk -F. '{print $1}'
- else
- echo "${OCF_RESKEY_fqdn_prefix}$1"
- fi
-}
-
-# Return OCF_SUCCESS, if current host is in the list of given hosts.
-# Otherwise, return 10
-my_host() {
- local hostlist="$1"
- local hostname
- local hn
- local rc=10
- local LH="${LL} my_host():"
-
- hostname=$(process_fqdn $(get_hostname))
- ocf_log info "${LH} hostlist is: $hostlist"
- for host in $hostlist ; do
- hn=$(process_fqdn "${host}")
- ocf_log debug "${LH} comparing '$hostname' with '$hn'"
- if [ "${hostname}" = "${hn}" ] ; then
- rc=$OCF_SUCCESS
- break
- fi
- done
-
- return $rc
-}
-
-get_integer_node_attr() {
- local value
- value=$(crm_attribute -N $1 -l reboot --name "$2" --query 2>/dev/null | awk '{ split($3, vals, "="); if (vals[2] != "(null)") print vals[2] }')
- if [ $? -ne 0 -o -z "$value" ] ; then
- value=0
- fi
- echo $value
-}
-
-get_node_start_time() {
- get_integer_node_attr $1 'rabbit-start-time'
-}
-
-get_node_master_score() {
- get_integer_node_attr $1 'master-p_rabbitmq-server'
-}
-
-# Return either rabbit node name as FQDN or shortname, depends on the OCF_RESKEY_use_fqdn.
-rabbit_node_name() {
- echo "rabbit@$(process_fqdn $1)"
-}
-
-rmq_setup_env() {
- local H
- local dir
- H="$(get_hostname)"
- export RABBITMQ_NODENAME=$(rabbit_node_name $H)
- export RABBITMQ_NODE_PORT=$OCF_RESKEY_node_port
- export RABBITMQ_PID_FILE=$OCF_RESKEY_pid_file
- MNESIA_FILES="${OCF_RESKEY_mnesia_base}/$(rabbit_node_name $H)"
- RMQ_START_TIME="${MNESIA_FILES}/ocf_server_start_time.txt"
- MASTER_FLAG_FILE="${MNESIA_FILES}/ocf_master_for_${OCF_RESOURCE_INSTANCE}"
- THIS_PCMK_NODE=`crm_node -n`
- TOTALVMEM=`free -mt | awk '/Total:/ {print $2}'`
- # check and make PID file dir
- local PID_DIR=$( dirname $OCF_RESKEY_pid_file )
- if [ ! -d ${PID_DIR} ] ; then
- mkdir -p ${PID_DIR}
- chown -R ${OCF_RESKEY_username}:${OCF_RESKEY_groupname} ${PID_DIR}
- chmod 755 ${PID_DIR}
- fi
-
- # Regardless of whether we just created the directory or it
- # already existed, check whether it is writable by the configured
- # user
- for dir in ${PID_DIR} "${OCF_RESKEY_mnesia_base}" "${OCF_RESKEY_log_dir}"; do
- if test -e ${dir}; then
- local files
- files=$(su -s /bin/sh - $OCF_RESKEY_username -c "find ${dir} ! -writable")
- if [ "${files}" ]; then
- ocf_log warn "Directory ${dir} is not writable by ${OCF_RESKEY_username}, chowning."
- chown -R ${OCF_RESKEY_username}:${OCF_RESKEY_groupname} "${dir}"
- fi
- fi
- done
-
- export LL="${OCF_RESOURCE_INSTANCE}[$$]:"
- update_cookie
-}
-
-# Return a RabbitMQ node to its virgin state.
-# For reset and force_reset to succeed the RabbitMQ application must have been stopped.
-# If the app cannot be stopped, beam will be killed and mnesia files will be removed.
-reset_mnesia() {
- local LH="${LL} reset_mnesia():"
- local make_amnesia=false
- local rc=$OCF_ERR_GENERIC
-
- # check status of a beam process
- get_status
- rc=$?
- if [ $rc -eq 0 ] ; then
- # beam is running
- # check status of rabbit app and stop it, if it is running
- get_status rabbit
- rc=$?
- if [ $rc -eq 0 ] ; then
- # rabbit app is running, have to stop it
- ocf_log info "${LH} Stopping RMQ-app prior to reset the mnesia."
- stop_rmq_server_app
- rc=$?
- if [ $rc -ne 0 ] ; then
- ocf_log warn "${LH} RMQ-app can't be stopped."
- make_amnesia=true
- fi
- fi
-
- if ! $make_amnesia ; then
- # rabbit app is not running, reset mnesia
- ocf_log info "${LH} Execute reset with timeout: ${TIMEOUT_ARG}"
- su_rabbit_cmd "${OCF_RESKEY_ctl} reset"
- rc=$?
- if [ $rc -ne 0 ] ; then
- ocf_log info "${LH} Execute force_reset with timeout: ${TIMEOUT_ARG}"
- su_rabbit_cmd "${OCF_RESKEY_ctl} force_reset"
- rc=$?
- if [ $rc -ne 0 ] ; then
- ocf_log warn "${LH} Mnesia couldn't cleaned, even by force-reset command."
- make_amnesia=true
- fi
- fi
- fi
- else
- # there is no beam running
- make_amnesia=true
- ocf_log warn "${LH} There is no Beam process running."
- fi
-
- # remove mnesia files, if required
- if $make_amnesia ; then
- kill_rmq_and_remove_pid
- ocf_run rm -rf "${MNESIA_FILES}"
- mnesia_schema_location="${OCF_RESKEY_mnesia_schema_base}/Mnesia.$(rabbit_node_name $(get_hostname))"
- ocf_run rm -rf "$mnesia_schema_location"
- ocf_log warn "${LH} Mnesia files appear corrupted and have been removed from ${MNESIA_FILES} and $mnesia_schema_location"
- fi
- # always return OCF SUCCESS
- return $OCF_SUCCESS
-}
-
-
-block_client_access()
-{
- # do not add temporary RMQ blocking rule, if it is already exist
- # otherwise, try to add a blocking rule with max of 5 retries
- local tries=5
- until $(iptables -nvL --wait | grep -q 'temporary RMQ block') || [ $tries -eq 0 ]; do
- tries=$((tries-1))
- iptables --wait -I INPUT -p tcp -m tcp --dport ${OCF_RESKEY_node_port} -m state --state NEW,RELATED,ESTABLISHED \
- -m comment --comment 'temporary RMQ block' -j REJECT --reject-with tcp-reset
- sleep 1
- done
- if [ $tries -eq 0 ]; then
- return $OCF_ERR_GENERIC
- else
- return $OCF_SUCCESS
- fi
-}
-
-unblock_client_access()
-{
- # remove all temporary RMQ blocking rules, if there are more than one exist
- for i in $(iptables -nvL --wait --line-numbers | awk '/temporary RMQ block/ {print $1}'); do
- iptables --wait -D INPUT -p tcp -m tcp --dport ${OCF_RESKEY_node_port} -m state --state NEW,RELATED,ESTABLISHED \
- -m comment --comment 'temporary RMQ block' -j REJECT --reject-with tcp-reset
- done
-}
-
-get_nodes__base(){
- local infotype=''
- local rc=$OCF_ERR_GENERIC
- local c_status
-
- if [ "$1" = 'nodes' ]
- then
- infotype='db_nodes'
- elif [ "$1" = 'running' ]
- then
- infotype='running_db_nodes'
- fi
- c_status=`${OCF_RESKEY_ctl} eval "mnesia:system_info(${infotype})." 2>/dev/null`
- rc=$?
- if [ $rc -ne 0 ] ; then
- echo ''
- return $OCF_ERR_GENERIC
- fi
- # translate line like '{running_nodes,['rabbit@node-1','rabbit@node-2','rabbit@node-3']},' to node_list
- echo $(echo "${c_status}" | awk -F, '{ for (i=1;i<=NF;i++) { if ($i ~ /@/) { gsub(/[\[\]}{]/,"",$i); print $i; } }}' | tr -d "\'")
- return $OCF_SUCCESS
-}
-
-get_nodes() {
- echo $(get_nodes__base nodes)
- return $?
-}
-
-get_running_nodes() {
- echo $(get_nodes__base running)
- return $?
-}
-
-# Get all known cluster nodes including offline ones
-get_all_pacemaker_nodes()
-{
- echo `crm_node -l | awk '{print $2}' | grep -v "^$" | sed -e '/(null)/d'`
-}
-
-# Get alive cluster nodes in visible partition, but the specified one
-get_alive_pacemaker_nodes_but()
-{
- if [ -z "$1" ]; then
- echo `crm_node -l -p | sed -e '/(null)/d'`
- else
- echo `crm_node -l -p | sed -e "s/${1}//g" | sed -e '/(null)/d'`
- fi
-}
-
-# Get current master. If a parameter is provided,
-# do not check node with that name
-get_master_name_but()
-{
- local node
- for node in $(get_alive_pacemaker_nodes_but "$@")
- do
- ocf_log info "${LH} looking if $node is master"
-
- if is_master $node; then
- ocf_log info "${LH} master is $node"
- echo $node
- break
- fi
- done
-}
-
-erl_eval() {
- local fmt="${1:?}"
- shift
-
- ${OCF_RESKEY_ctl} eval "$(printf "$fmt" "$@")"
-}
-
-# Returns 0 if we are clustered with provideded node
-is_clustered_with()
-{
- local LH="${LH}: is_clustered_with: "
- local node_name
- local rc
- node_name=$(rabbit_node_name $1)
-
- local seen_as_running
- seen_as_running=$(erl_eval "lists:member('%s', rabbit_mnesia:cluster_nodes(running))." "$node_name")
- rc=$?
- if [ "$rc" -ne 0 ]; then
- ocf_log err "${LH} Failed to check whether '$node_name' is considered running by us"
- # XXX Or should we give remote node benefit of a doubt?
- return 1
- elif [ "$seen_as_running" != true ]; then
- ocf_log info "${LH} Node $node_name is not running, considering it not clustered with us"
- return 1
- fi
-
- local seen_as_partitioned
- seen_as_partitioned=$(erl_eval "lists:member('%s', rabbit_node_monitor:partitions())." "$node_name")
- rc=$?
- if [ "$rc" -ne 0 ]; then
- ocf_log err "${LH} Failed to check whether '$node_name' is partitioned with us"
- # XXX Or should we give remote node benefit of a doubt?
- return 1
- elif [ "$seen_as_partitioned" != false ]; then
- ocf_log info "${LH} Node $node_name is partitioned from us"
- return 1
- fi
-
- return $?
-}
-
-
-check_need_join_to() {
- local join_to
- local node
- local running_nodes
- local rc=$OCF_ERR_GENERIC
-
- rc=0
- join_to=$(rabbit_node_name $1)
- running_nodes=$(get_running_nodes)
- for node in $running_nodes ; do
- if [ "${join_to}" = "${node}" ] ; then
- rc=1
- break
- fi
- done
-
- return $rc
-}
-
-# Update erlang cookie, if it has been specified
-update_cookie() {
- local cookie_file_content
- if [ "${OCF_RESKEY_erlang_cookie}" != 'false' ] ; then
- if [ -f "${OCF_RESKEY_erlang_cookie_file}" ]; then
- # First line of cookie file without newline
- cookie_file_content=$(head -n1 "${OCF_RESKEY_erlang_cookie_file}" | perl -pe chomp)
- fi
- # As there is a brief period of time when the file is empty
- # (shell redirection has already opened and truncated file,
- # and echo hasn't finished its job), we are doing this write
- # only when cookie has changed.
- if [ "${OCF_RESKEY_erlang_cookie}" != "${cookie_file_content}" ]; then
- echo "${OCF_RESKEY_erlang_cookie}" > "${OCF_RESKEY_erlang_cookie_file}"
- fi
- # And this are idempotent operations, so we don't have to
- # check any preconditions for running them.
- chown ${OCF_RESKEY_username}:${OCF_RESKEY_groupname} "${OCF_RESKEY_erlang_cookie_file}"
- chmod 600 "${OCF_RESKEY_erlang_cookie_file}"
- fi
- return $OCF_SUCCESS
-}
-
-# Stop rmq beam process by pid and by rabbit node name match. Returns SUCCESS/ERROR
-kill_rmq_and_remove_pid() {
- local LH="${LL} kill_rmq_and_remove_pid():"
- # Stop the rabbitmq-server by its pidfile, use the name matching as a fallback,
- # and ignore the exit code
- proc_stop "${OCF_RESKEY_pid_file}" "beam.*${RABBITMQ_NODENAME}" "${OCF_RESKEY_stop_time}"
- # Ensure the beam.smp stopped by the rabbit node name matching as well
- proc_stop none "beam.*${RABBITMQ_NODENAME}" "${OCF_RESKEY_stop_time}"
- if [ $? -eq 0 ] ; then
- return $OCF_SUCCESS
- else
- return $OCF_ERR_GENERIC
- fi
-}
-
-trim_var(){
- local string="$*"
- echo ${string%% }
-}
-
-action_validate() {
- # todo(sv): validate some incoming parameters
- OCF_RESKEY_CRM_meta_notify_post=$(trim_var $OCF_RESKEY_CRM_meta_notify_post)
- OCF_RESKEY_CRM_meta_notify_pre=$(trim_var $OCF_RESKEY_CRM_meta_notify_pre)
- OCF_RESKEY_CRM_meta_notify_start=$(trim_var $OCF_RESKEY_CRM_meta_notify_start)
- OCF_RESKEY_CRM_meta_notify_stop=$(trim_var $OCF_RESKEY_CRM_meta_notify_stop)
- OCF_RESKEY_CRM_meta_notify_start_resource=$(trim_var $OCF_RESKEY_CRM_meta_notify_start_resource)
- OCF_RESKEY_CRM_meta_notify_stop_resource=$(trim_var $OCF_RESKEY_CRM_meta_notify_stop_resource)
- OCF_RESKEY_CRM_meta_notify_active_resource=$(trim_var $OCF_RESKEY_CRM_meta_notify_active_resource)
- OCF_RESKEY_CRM_meta_notify_inactive_resource=$(trim_var $OCF_RESKEY_CRM_meta_notify_inactive_resource)
- OCF_RESKEY_CRM_meta_notify_start_uname=$(trim_var $OCF_RESKEY_CRM_meta_notify_start_uname)
- OCF_RESKEY_CRM_meta_notify_stop_uname=$(trim_var $OCF_RESKEY_CRM_meta_notify_stop_uname)
- OCF_RESKEY_CRM_meta_notify_active_uname=$(trim_var $OCF_RESKEY_CRM_meta_notify_active_uname)
- OCF_RESKEY_CRM_meta_notify_master_resource=$(trim_var $OCF_RESKEY_CRM_meta_notify_master_resource)
- OCF_RESKEY_CRM_meta_notify_master_uname=$(trim_var $OCF_RESKEY_CRM_meta_notify_master_uname)
- OCF_RESKEY_CRM_meta_notify_demote_resource=$(trim_var $OCF_RESKEY_CRM_meta_notify_demote_resource)
- OCF_RESKEY_CRM_meta_notify_demote_uname=$(trim_var $OCF_RESKEY_CRM_meta_notify_demote_uname)
- OCF_RESKEY_CRM_meta_notify_slave_resource=$(trim_var $OCF_RESKEY_CRM_meta_notify_slave_resource)
- OCF_RESKEY_CRM_meta_notify_slave_uname=$(trim_var $OCF_RESKEY_CRM_meta_notify_slave_uname)
- OCF_RESKEY_CRM_meta_notify_promote_resource=$(trim_var $OCF_RESKEY_CRM_meta_notify_promote_resource)
- OCF_RESKEY_CRM_meta_notify_promote_uname=$(trim_var $OCF_RESKEY_CRM_meta_notify_promote_uname)
- return $OCF_SUCCESS
-}
-
-update_rabbit_start_time_if_rc() {
- local nowtime
- local rc=$1
- if [ $rc -eq 0 ]; then
- nowtime="$(now)"
- ocf_log info "${LH} Rabbit app started successfully. Updating start time attribute with ${nowtime}"
- ocf_run crm_attribute -N $THIS_PCMK_NODE -l reboot --name 'rabbit-start-time' --update "${nowtime}"
- fi
-}
-
-join_to_cluster() {
- local node="$1"
- local rmq_node
- local rc=$OCF_ERR_GENERIC
- local LH="${LL} join_to_cluster():"
-
- ocf_log info "${LH} start."
-
- rmq_node=$(rabbit_node_name $node)
- ocf_log info "${LH} Joining to cluster by node '${rmq_node}'."
- get_status rabbit
- rc=$?
- if [ $rc -eq $OCF_SUCCESS ] ; then
- ocf_log info "${LH} rabbitmq app will be stopped."
- stop_rmq_server_app
- rc=$?
- if [ $rc -ne 0 ] ; then
- ocf_log err "${LH} Can't stop rabbitmq app by stop_app command. Stopping."
- action_stop
- return $OCF_ERR_GENERIC
- fi
- fi
- ocf_log info "${LH} Execute join_cluster with timeout: ${TIMEOUT_ARG}"
- su_rabbit_cmd "${OCF_RESKEY_ctl} join_cluster $rmq_node"
- rc=$?
- if [ $rc -ne 0 ] ; then
- ocf_log err "${LH} Can't join to cluster by node '${rmq_node}'. Stopping."
- action_stop
- return $OCF_ERR_GENERIC
- fi
- sleep 2
- try_to_start_rmq_app
- rc=$?
- if [ $rc -ne 0 ] ; then
- ocf_log err "${LH} Can't start RMQ app after join to cluster. Stopping."
- action_stop
- return $OCF_ERR_GENERIC
- else
- update_rabbit_start_time_if_rc 0
- ocf_log info "${LH} Joined to cluster succesfully."
- fi
-
- ocf_log info "${LH} end."
- return $rc
-}
-
-unjoin_nodes_from_cluster() {
- # node names of the nodes where the pcs resource is being stopped
- local nodelist="$1"
- local hostname
- local nodename
- local rc=$OCF_ERR_GENERIC
- local rnode
- # nodes in rabbit cluster db
- local nodes_in_cluster
- local LH="${LL} unjoin_nodes_from_cluster():"
-
- nodes_in_cluster=$(get_nodes)
- rc=$?
- if [ $rc -ne 0 ] ; then
- # no nodes in node list, nothing to do
- return $OCF_SUCCESS
- fi
-
- # unjoin all cluster nodes which are being stopped (i.e. recieved post-stop notify), except *this* node
- # before to unjoin the nodes, make sure they were disconnected from *this* node
- for hostname in $nodelist ; do
- nodename=$(rabbit_node_name $hostname)
- if [ "${nodename}" = "${RABBITMQ_NODENAME}" ] ; then
- continue
- fi
- for rnode in $nodes_in_cluster ; do
- if [ "${nodename}" = "${rnode}" ] ; then
- # disconnect node being unjoined from this node
- ocf_run ${OCF_RESKEY_ctl} eval "disconnect_node(list_to_atom(\"${nodename}\"))." 2>&1
- rc=$?
- if [ $rc -eq $OCF_SUCCESS ] ; then
- ocf_log info "${LH} node '${nodename}' disconnected succesfully."
- else
- ocf_log info "${LH} disconnecting node '${nodename}' failed."
- fi
-
- # unjoin node
- # when the rabbit node went down, its status
- # remains 'running' for a while, so few retries are required
- local tries=0
- until [ $tries -eq 5 ]; do
- tries=$((tries+1))
- if is_clustered_with $nodename; then
- ocf_log info "${LH} the ${nodename} is alive and cannot be kicked from the cluster yet"
- else
- break
- fi
- sleep 10
- done
- ocf_log info "${LH} Execute forget_cluster_node with timeout: ${TIMEOUT_ARG}"
- su_rabbit_cmd "${OCF_RESKEY_ctl} forget_cluster_node ${nodename}"
- rc=$?
- if [ $rc -eq 0 ] ; then
- ocf_log info "${LH} node '${nodename}' unjoined succesfully."
- else
- ocf_log warn "${LH} unjoining node '${nodename}' failed."
- fi
- fi
- done
- done
- return $OCF_SUCCESS
-}
-
-# Stop RMQ beam server process. Returns SUCCESS/ERROR
-stop_server_process() {
- local pid
- local rc=$OCF_ERR_GENERIC
- local LH="${LL} stop_server_process():"
-
- pid=$(cat ${OCF_RESKEY_pid_file})
- rc=$?
- if [ $rc -ne 0 ] ; then
- # Try to stop without known PID
- ocf_log err "${LH} RMQ-server process PIDFILE was not found!"
- su_rabbit_cmd "${OCF_RESKEY_ctl} stop >> \"${OCF_RESKEY_log_dir}/shutdown_log\" 2>&1"
- if [ $? -eq 0 ] ; then
- ocf_log info "${LH} RMQ-server process stopped succesfully, although there was no PIDFILE found."
- ocf_log info "${LH} grant a graceful termintation window ${OCF_RESKEY_stop_time} to end its beam"
- sleep "${OCF_RESKEY_stop_time}"
- else
- kill_rmq_and_remove_pid
- fi
- elif [ "${pid}" ] ; then
- # Try to stop gracefully by known PID
- ocf_log info "${LH} Execute stop with timeout: ${TIMEOUT_ARG}"
- su_rabbit_cmd "${OCF_RESKEY_ctl} stop ${OCF_RESKEY_pid_file} >> \"${OCF_RESKEY_log_dir}/shutdown_log\" 2>&1"
- [ $? -eq 0 ] && ocf_log info "${LH} RMQ-server process (PID=${pid}) stopped succesfully."
- fi
-
- # Ensure there is no beam process and pidfile left
- pgrep -f "beam.*${RABBITMQ_NODENAME}" > /dev/null
- rc=$?
- if [ -f ${OCF_RESKEY_pid_file} -o $rc -eq 0 ] ; then
- ocf_log warn "${LH} The pidfile or beam's still exist, forcing the RMQ-server cleanup"
- kill_rmq_and_remove_pid
- fi
-
- # Return the actual status
- get_status
- if [ $? -ne 0 ] ; then
- return $OCF_SUCCESS
- else
- return $OCF_ERR_GENERIC
- fi
-}
-
-# Stop RMQ-app. Return OCF_SUCCESS, if the app was stopped,
-# otherwise return OCF_ERR_GENERIC
-stop_rmq_server_app() {
- local rc=$OCF_ERR_GENERIC
-
- # if the beam process isn't running, then rabbit app is stopped as well
- get_status
- rc=$?
- if [ $rc -ne 0 ] ; then
- return $OCF_SUCCESS
- fi
-
- # stop the app
- ocf_log info "${LH} Execute stop_app with timeout: ${TIMEOUT_ARG}"
- su_rabbit_cmd "${OCF_RESKEY_ctl} stop_app >> \"${OCF_RESKEY_log_dir}/shutdown_log\" 2>&1"
- rc=$?
- if [ $rc -ne 0 ] ; then
- ocf_log err "${LH} RMQ-server app cannot be stopped."
- return $OCF_ERR_GENERIC
- fi
-
- get_status rabbit
- rc=$?
- if [ $rc -ne $OCF_SUCCESS ] ; then
- ocf_log info "${LH} RMQ-server app stopped succesfully."
- rc=$OCF_SUCCESS
- else
- ocf_log err "${LH} RMQ-server app cannot be stopped."
- rc=$OCF_ERR_GENERIC
- fi
-
- return $rc
-}
-
-start_beam_process() {
- local command
- local rc=$OCF_ERR_GENERIC
- local ts_end
- local pf_end
- local pid
- local LH="${LL} start_beam_process():"
-
- # remove old PID-file if it exists
- if [ -f "${OCF_RESKEY_pid_file}" ] ; then
- ocf_log warn "${LH} found old PID-file '${OCF_RESKEY_pid_file}'."
- pid=$(cat ${OCF_RESKEY_pid_file})
- if [ "${pid}" -a -d "/proc/${pid}" ] ; then
- ocf_run cat /proc/${pid}/cmdline | grep -c 'bin/beam' > /dev/null 2>&1
- rc=$?
- if [ $rc -eq $OCF_SUCCESS ] ; then
- ocf_log warn "${LH} found beam process with PID=${pid}, killing...'."
- ocf_run kill -TERM $pid
- else
- ocf_log err "${LH} found unknown process with PID=${pid} from '${OCF_RESKEY_pid_file}'."
- return $OCF_ERR_GENERIC
- fi
- fi
- ocf_run rm -f $OCF_RESKEY_pid_file
- fi
-
- [ -f /etc/default/rabbitmq-server ] && . /etc/default/rabbitmq-server
-
- # run beam process
- command="${OCF_RESKEY_binary} >> \"${OCF_RESKEY_log_dir}/startup_log\" 2>/dev/null"
- RABBITMQ_NODE_ONLY=1 su rabbitmq -s /bin/sh -c "${command}"&
- ts_end=$(( $(now) + ${OCF_RESKEY_start_time} ))
- rc=$OCF_ERR_GENERIC
- while [ $(now) -lt ${ts_end} ]; do
- # waiting for normal start of beam
- pid=0
- pf_end=$(( $(now) + 3 ))
- while [ $(now) -lt ${pf_end} ]; do
- # waiting for OCF_RESKEY_pid_file of beam process
- if [ -f "${OCF_RESKEY_pid_file}" ] ; then
- pid=$(cat ${OCF_RESKEY_pid_file})
- break
- fi
- sleep 1
- done
- if [ "${pid}" != "0" -a -d "/proc/${pid}" ] ; then
- rc=$OCF_SUCCESS
- break
- fi
- sleep 2
- done
- if [ $rc -ne $OCF_SUCCESS ]; then
- if [ "${pid}" = "0" ] ; then
- ocf_log warn "${LH} PID-file '${OCF_RESKEY_pid_file}' not found"
- fi
- ocf_log err "${LH} RMQ-runtime (beam) didn't start succesfully (rc=${rc})."
- fi
-
- return $rc
-}
-
-check_plugins() {
- # Check if it's safe to load plugins and if we need to do so. Logic is:
- # if (EnabledPlugins > 0) and (ActivePlugins == 0) ; then it's safe to load
- # If we have at least one active plugin, then it's not safe to re-load them
- # because plugins:setup() would remove existing dependency plugins in plugins_expand_dir.
- ${OCF_RESKEY_ctl} eval '{ok, EnabledFile} = application:get_env(rabbit, enabled_plugins_file), EnabledPlugins = rabbit_plugins:read_enabled(EnabledFile), ActivePlugins = rabbit_plugins:active(), if length(EnabledPlugins)>0 -> if length(ActivePlugins)==0 -> erlang:error("need_to_load_plugins"); true -> false end; true -> false end.'
- return $?
-}
-
-load_plugins() {
- check_plugins
- local rc=$?
- if [ $rc -eq 0 ] ; then
- return 0
- else
- ${OCF_RESKEY_ctl} eval 'ToBeLoaded = rabbit_plugins:setup(), ok = app_utils:load_applications(ToBeLoaded), StartupApps = app_utils:app_dependency_order(ToBeLoaded,false), app_utils:start_applications(StartupApps).'
- return $?
- fi
-}
-
-list_active_plugins() {
- local list
- list=`${OCF_RESKEY_ctl} eval 'rabbit_plugins:active().'`
- echo "${list}"
-}
-
-try_to_start_rmq_app() {
- local startup_log="${1:-${OCF_RESKEY_log_dir}/startup_log}"
- local rc=$OCF_ERR_GENERIC
- local LH="${LL} try_to_start_rmq_app():"
-
- get_status
- rc=$?
- if [ $rc -ne $OCF_SUCCESS ] ; then
- ocf_log info "${LH} RMQ-runtime (beam) not started, starting..."
- start_beam_process
- rc=$?
- if [ $rc -ne $OCF_SUCCESS ]; then
- ocf_log err "${LH} Failed to start beam - returning from the function"
- return $OCF_ERR_GENERIC
- fi
- fi
-
-
- if [ -z "${startup_log}" ] ; then
- startup_log="${OCF_RESKEY_log_dir}/startup_log"
- fi
-
- ocf_log info "${LH} begin."
- ocf_log info "${LH} Execute start_app with timeout: ${TIMEOUT_ARG}"
- su_rabbit_cmd "${OCF_RESKEY_ctl} start_app >>${startup_log} 2>&1"
- rc=$?
- if [ $rc -eq 0 ] ; then
- ocf_log info "${LH} start_app was successful."
- ocf_log info "${LH} waiting for start to finish with timeout: ${TIMEOUT_ARG}"
- su_rabbit_cmd "${OCF_RESKEY_ctl} wait ${OCF_RESKEY_pid_file}"
- rc=$?
- if [ $rc -ne 0 ] ; then
- ocf_log err "${LH} RMQ-server app failed to wait for start."
- return $OCF_ERR_GENERIC
- fi
- rc=$OCF_SUCCESS
- # Loading enabled modules
- ocf_log info "${LH} start plugins."
- load_plugins
- local mrc=$?
- if [ $mrc -eq 0 ] ; then
- local mlist
- mlist=`list_active_plugins`
- ocf_log info "${LH} Starting plugins: ${mlist}"
- else
- ocf_log info "${LH} Starting plugins: failed."
- fi
- else
- ocf_log info "${LH} start_app failed."
- rc=$OCF_ERR_GENERIC
- fi
- return $rc
-}
-
-start_rmq_server_app() {
- local rc=$OCF_ERR_GENERIC
- local startup_log="${OCF_RESKEY_log_dir}/startup_log"
- local startup_output
- local LH="${LL} start_rmq_server_app():"
- local a
-
- #We are performing initial start check.
- #We are not ready to provide service.
- #Clients should not have access.
-
-
- ocf_log info "${LH} begin."
- # Safe-unblock the rules, if there are any
- unblock_client_access
- # Apply the blocking rule
- block_client_access
- rc=$?
- if [ $rc -eq $OCF_SUCCESS ]; then
- ocf_log info "${LH} blocked access to RMQ port"
- else
- ocf_log err "${LH} cannot block access to RMQ port!"
- return $OCF_ERR_GENERIC
- fi
- get_status
- rc=$?
- if [ $rc -ne $OCF_SUCCESS ] ; then
- ocf_log info "${LH} RMQ-runtime (beam) not started, starting..."
- start_beam_process
- rc=$?
- if [ $rc -ne $OCF_SUCCESS ]; then
- unblock_client_access
- ocf_log info "${LH} unblocked access to RMQ port"
- return $OCF_ERR_GENERIC
- fi
- fi
-
- ocf_log info "${LH} RMQ-server app not started, starting..."
- try_to_start_rmq_app "$startup_log"
- rc=$?
- if [ $rc -eq $OCF_SUCCESS ] ; then
- # rabbitmq-server started successfuly as master of cluster
- master_score $MIN_MASTER_SCORE
- stop_rmq_server_app
- rc=$?
- if [ $rc -ne 0 ] ; then
- ocf_log err "${LH} RMQ-server app can't be stopped. Beam will be killed."
- kill_rmq_and_remove_pid
- unblock_client_access
- ocf_log info "${LH} unblocked access to RMQ port"
- return $OCF_ERR_GENERIC
- fi
- else
- # error at start RMQ-server
- ocf_log warn "${LH} RMQ-server app can't start without Mnesia cleaning."
- for a in $(seq 1 10) ; do
- rc=$OCF_ERR_GENERIC
- reset_mnesia || break
- try_to_start_rmq_app "$startup_log"
- rc=$?
- if [ $rc -eq $OCF_SUCCESS ]; then
- stop_rmq_server_app
- rc=$?
- if [ $rc -eq $OCF_SUCCESS ]; then
- ocf_log info "${LH} RMQ-server app Mnesia cleaned successfully."
- rc=$OCF_SUCCESS
- master_score $MIN_MASTER_SCORE
- break
- else
- ocf_log err "${LH} RMQ-server app can't be stopped during Mnesia cleaning. Beam will be killed."
- kill_rmq_and_remove_pid
- unblock_client_access
- ocf_log info "${LH} unblocked access to RMQ port"
- return $OCF_ERR_GENERIC
- fi
- fi
- done
- fi
- if [ $rc -eq $OCF_ERR_GENERIC ] ; then
- ocf_log err "${LH} RMQ-server can't be started while many tries. Beam will be killed."
- kill_rmq_and_remove_pid
- fi
- ocf_log info "${LH} end."
- unblock_client_access
- ocf_log info "${LH} unblocked access to RMQ port"
- return $rc
-}
-
-# check status of rabbit beam process or a rabbit app, if rabbit arg specified
-# by default, test if the kernel app is running, otherwise consider it is "not running"
-get_status() {
- local what="${1:-kernel}"
- local rc=$OCF_NOT_RUNNING
- local LH="${LL} get_status():"
- local body
- local beam_running
-
- body=$( ${COMMAND_TIMEOUT} ${OCF_RESKEY_ctl} eval 'rabbit_misc:which_applications().' 2>&1 )
- rc=$?
-
- pgrep -f "beam.*${RABBITMQ_NODENAME}" > /dev/null
- beam_running=$?
- # report not running only if the which_applications() reported an error AND the beam is not running
- if [ $rc -ne 0 -a $beam_running -ne 0 ] ; then
- ocf_log info "${LH} failed with code ${rc}. Command output: ${body}"
- return $OCF_NOT_RUNNING
- # return a generic error, if there were errors and beam is found running
- elif [ $rc -ne 0 ] ; then
- ocf_log info "${LH} found the beam process running but failed with code ${rc}. Command output: ${body}"
- return $OCF_ERR_GENERIC
- fi
-
- # try to parse the which_applications() output only if it exited w/o errors
- if [ "${what}" -a $rc -eq 0 ] ; then
- rc=$OCF_NOT_RUNNING
- echo "$body" | grep "\{${what}," > /dev/null 2>&1 && rc=$OCF_SUCCESS
-
- if [ $rc -ne $OCF_SUCCESS ] ; then
- ocf_log info "${LH} app ${what} was not found in command output: ${body}"
- fi
- fi
-
- [ $rc -ne $OCF_SUCCESS ] && rc=$OCF_NOT_RUNNING
- return $rc
-}
-
-action_status() {
- local rc=$OCF_ERR_GENERIC
-
- get_status
- rc=$?
- return $rc
-}
-
-# return 0, if given node has a master attribute in CIB,
-# otherwise, return 1
-is_master() {
- local result
- result=`crm_attribute -N "${1}" -l reboot --name 'rabbit-master' --query 2>/dev/null |\
- awk '{print $3}' | awk -F "=" '{print $2}' | sed -e '/(null)/d'`
- if [ "${result}" != 'true' ] ; then
- return 1
- fi
- return 0
-}
-
-# Verify if su_rabbit_cmd exited by timeout by checking its return code.
-# If it did not, return 0. If it did AND it is
-# $OCF_RESKEY_max_rabbitmqctl_timeouts'th timeout in a row,
-# return 2 to signal get_monitor that it should
-# exit with error. Otherwise return 1 to signal that there was a timeout,
-# but it should be ignored. Timeouts for different operations are tracked
-# separately. The second argument is used to distingush them.
-check_timeouts() {
- local op_rc=$1
- local timeouts_attr_name=$2
- local op_name=$3
-
- # 75 is EX_TEMPFAIL from sysexits, and is used by rabbitmqctl to signal about
- # timeout.
- if [ $op_rc -ne 124 -a $op_rc -ne 137 -a $op_rc -ne 75 ]; then
- ocf_update_private_attr $timeouts_attr_name 0
- return 0
- fi
-
- local count
- count=$(ocf_get_private_attr $timeouts_attr_name 0)
-
- count=$((count+1))
- # There is a slight chance that this piece of code will be executed twice simultaneously.
- # As a result, $timeouts_attr_name's value will be one less than it should be. But we don't need
- # precise calculation here.
- ocf_update_private_attr $timeouts_attr_name $count
-
- if [ $count -lt $OCF_RESKEY_max_rabbitmqctl_timeouts ]; then
- ocf_log warn "${LH} 'rabbitmqctl $op_name' timed out $count of max. $OCF_RESKEY_max_rabbitmqctl_timeouts time(s) in a row. Doing nothing for now."
- return 1
- else
- ocf_log err "${LH} 'rabbitmqctl $op_name' timed out $count of max. $OCF_RESKEY_max_rabbitmqctl_timeouts time(s) in a row and is not responding. The resource is failed."
- return 2
- fi
-}
-
-wait_sync() {
- local wait_time=$1
- local queues
- local opt_arg=""
-
- if [ "$OCF_RESKEY_rmq_feature_local_list_queues" = "true" ]; then
- opt_arg="--local"
- fi
-
- queues="${COMMAND_TIMEOUT} ${OCF_RESKEY_ctl} list_queues $opt_arg name state"
-
- su_rabbit_cmd -t "${wait_time}" "sh -c \"while ${queues} | grep -q 'syncing,'; \
- do sleep 2; done\""
-
- return $?
-}
-
-get_monitor() {
- local rc=$OCF_ERR_GENERIC
- local LH="${LL} get_monitor():"
- local status_master=1
- local rabbit_running
- local name
- local node
- local node_start_time
- local nowtime
-
- ocf_log info "${LH} CHECK LEVEL IS: ${OCF_CHECK_LEVEL}"
- get_status
- rc=$?
- if [ $rc -eq $OCF_NOT_RUNNING ] ; then
- ocf_log info "${LH} get_status() returns ${rc}."
- ocf_log info "${LH} ensuring this slave does not get promoted."
- master_score 0
- return $OCF_NOT_RUNNING
- elif [ $rc -eq $OCF_SUCCESS ] ; then
- ocf_log info "${LH} get_status() returns ${rc}."
- ocf_log info "${LH} also checking if we are master."
- get_status rabbit
- rabbit_running=$?
- is_master $THIS_PCMK_NODE
- status_master=$?
- ocf_log info "${LH} master attribute is ${status_master}"
- if [ $status_master -eq 0 -a $rabbit_running -eq $OCF_SUCCESS ]
- then
- ocf_log info "${LH} We are the running master"
- rc=$OCF_RUNNING_MASTER
- elif [ $status_master -eq 0 -a $rabbit_running -ne $OCF_SUCCESS ] ; then
- ocf_log err "${LH} We are the master and RMQ-runtime (beam) is not running. this is a failure"
- exit $OCF_FAILED_MASTER
- fi
- fi
- get_status rabbit
- rabbit_running=$?
- ocf_log info "${LH} checking if rabbit app is running"
-
- if [ $rc -eq $OCF_RUNNING_MASTER ]; then
- if [ $rabbit_running -eq $OCF_SUCCESS ]; then
- ocf_log info "${LH} rabbit app is running and is master of cluster"
- else
- ocf_log err "${LH} we are the master and rabbit app is not running. This is a failure"
- exit $OCF_FAILED_MASTER
- fi
- else
- start_time=$((180 + $(ocf_get_private_attr 'rabbit-start-phase-1-time' 0)))
- restart_order_time=$((60 + $(ocf_get_private_attr 'rabbit-ordered-to-restart' 0)))
- nowtime=$(now)
-
- # If we started more than 3 minutes ago, and
- # we got order to restart less than 1 minute ago
- if [ $nowtime -lt $restart_order_time ]; then
- if [ $nowtime -gt $start_time ]; then
- ocf_log err "${LH} failing because we have received an order to restart from the master"
- stop_server_process
- rc=$OCF_ERR_GENERIC
- else
- ocf_log warn "${LH} received an order to restart from the master, ignoring it because we have just started"
- fi
- fi
- fi
-
- if [ $rc -eq $OCF_ERR_GENERIC ]; then
- ocf_log err "${LH} get_status() returns generic error ${rc}"
- ocf_log info "${LH} ensuring this slave does not get promoted."
- master_score 0
- return $OCF_ERR_GENERIC
- fi
-
- # Recounting our master score
- ocf_log info "${LH} preparing to update master score for node"
- local our_start_time
- local new_score
- local node_start_time
- local node_score
-
- our_start_time=$(get_node_start_time $THIS_PCMK_NODE)
-
- if [ $our_start_time -eq 0 ]; then
- new_score=$MIN_MASTER_SCORE
- else
- new_score=$BEST_MASTER_SCORE
- for node in $(get_alive_pacemaker_nodes_but $THIS_PCMK_NODE)
- do
- node_start_time=$(get_node_start_time $node)
- node_score=$(get_node_master_score $node)
-
- ocf_log info "${LH} comparing us (start time: $our_start_time, score: $new_score) with $node (start time: $node_start_time, score: $node_score)"
- if [ $node_start_time -ne 0 -a $node_score -ne 0 -a $node_start_time -lt $our_start_time ]; then
- new_score=$((node_score - 10 < new_score ? node_score - 10 : new_score ))
- fi
- done
- fi
-
- if [ "$new_score" -ne "$(get_node_master_score $THIS_PCMK_NODE)" ]; then
- master_score $new_score
- fi
- ocf_log info "${LH} our start time is $our_start_time and score is $new_score"
-
- # Skip all other checks if rabbit app is not running
- if [ $rabbit_running -ne $OCF_SUCCESS ]; then
- ocf_log info "${LH} RabbitMQ is not running, get_monitor function ready to return ${rc}"
- return $rc
- fi
-
- # rc can be SUCCESS or RUNNING_MASTER, don't touch it unless there
- # is some error uncovered by node_health_check
- if ! node_health_check; then
- rc=$OCF_ERR_GENERIC
- fi
-
- # If we are the master and healthy, check that we see other cluster members
- # Order a member to restart if we don't see it
- if [ $rc -eq $OCF_RUNNING_MASTER ] ; then
- for node in $(get_all_pacemaker_nodes); do
- if ! is_clustered_with $node; then
- nowtime=$(now)
-
- ocf_log warn "${LH} node $node is not connected with us, ordering it to restart."
- ocf_update_private_attr 'rabbit-ordered-to-restart' "$nowtime" "$node"
- fi
- done
- fi
-
- ocf_log info "${LH} get_monitor function ready to return ${rc}"
- return $rc
-}
-
-# Check if the rabbitmqctl control plane is alive.
-node_health_check() {
- local rc
- if [ "$OCF_RESKEY_rmq_feature_health_check" = true ]; then
- node_health_check_local
- rc=$?
- else
- node_health_check_legacy
- rc=$?
- fi
- return $rc
-}
-
-node_health_check_local() {
- local LH="${LH} node_health_check_local():"
- local rc
- local rc_timeouts
-
- # Give node_health_check some time to handle timeout by itself.
- # By using internal rabbitmqctl timeouts, we allow it to print
- # more useful diagnostics
- local timeout=$((TIMEOUT_ARG - 2))
- su_rabbit_cmd "${OCF_RESKEY_ctl} node_health_check -t $timeout"
- rc=$?
-
- check_timeouts $rc "rabbit_node_health_check_timeouts" "node_health_check"
- rc_timeouts=$?
-
- if [ "$rc_timeouts" -eq 2 ]; then
- master_score 0
- ocf_log info "${LH} node_health_check timed out, retry limit reached"
- return $OCF_ERR_GENERIC
- elif [ "$rc_timeouts" -eq 1 ]; then
- ocf_log info "${LH} node_health_check timed out, going to retry"
- return $OCF_SUCCESS
- fi
-
- if [ "$rc" -ne 0 ]; then
- ocf_log err "${LH} rabbitmqctl node_health_check exited with errors."
- return $OCF_ERR_GENERIC
- else
- return $OCF_SUCCESS
- fi
-}
-
-node_health_check_legacy() {
- local rc_alive
- local timeout_alive
- su_rabbit_cmd "${OCF_RESKEY_ctl} list_channels > /dev/null 2>&1"
- rc_alive=$?
- [ $rc_alive -eq 137 -o $rc_alive -eq 124 ] && ocf_log err "${LH} 'rabbitmqctl list_channels' timed out, per-node explanation: $(enhanced_list_channels)"
- check_timeouts $rc_alive "rabbit_list_channels_timeouts" "list_channels"
- timeout_alive=$?
-
- if [ $timeout_alive -eq 2 ]; then
- master_score 0
- return $OCF_ERR_GENERIC
- elif [ $timeout_alive -eq 0 ]; then
- if [ $rc_alive -ne 0 ]; then
- ocf_log err "${LH} rabbitmqctl list_channels exited with errors."
- rc=$OCF_ERR_GENERIC
- fi
- fi
-
- # Check for memory alarms for this Master or Slave node.
- # If alert found, reset the alarm
- # and restart the resource as it likely means a dead end situation
- # when rabbitmq cluster is running with blocked publishing due
- # to high memory watermark exceeded.
- local alarms
- local rc_alarms
- local timeout_alarms
- alarms=`su_rabbit_cmd "${OCF_RESKEY_ctl} -q eval 'rabbit_alarm:get_alarms().'"`
- rc_alarms=$?
- check_timeouts $rc_alarms "rabbit_get_alarms_timeouts" "get_alarms"
- timeout_alarms=$?
-
- if [ $timeout_alarms -eq 2 ]; then
- master_score 0
- return $OCF_ERR_GENERIC
-
- elif [ $timeout_alarms -eq 0 ]; then
- if [ $rc_alarms -ne 0 ]; then
- ocf_log err "${LH} rabbitmqctl get_alarms exited with errors."
- rc=$OCF_ERR_GENERIC
-
- elif [ -n "${alarms}" ]; then
- for node in ${alarms}; do
- name=`echo ${node} | perl -n -e "m/memory,'(?<n>\S+)+'/ && print \"$+{n}\n\""`
- if [ "${name}" = "${RABBITMQ_NODENAME}" ] ; then
- ocf_log err "${LH} Found raised memory alarm. Erasing the alarm and restarting."
- su_rabbit_cmd "${OCF_RESKEY_ctl} set_vm_memory_high_watermark 10 > /dev/null 2>&1"
- rc=$OCF_ERR_GENERIC
- break
- fi
- done
- fi
- fi
-
- if ! is_cluster_status_ok ; then
- rc=$OCF_ERR_GENERIC
- fi
-
- # Check if the list of all queues is available,
- # Also report some queues stats and total virtual memory.
- local queues
- local rc_queues
- local timeout_queues
- queues=`su_rabbit_cmd "${OCF_RESKEY_ctl} -q list_queues memory messages consumer_utilisation"`
- rc_queues=$?
- check_timeouts $rc_queues "rabbit_list_queues_timeouts" "list_queues"
- timeout_queues=$?
-
- if [ $timeout_queues -eq 2 ]; then
- master_score 0
- return $OCF_ERR_GENERIC
-
- elif [ $timeout_queues -eq 0 ]; then
- if [ $rc_queues -ne 0 ]; then
- ocf_log err "${LH} rabbitmqctl list_queues exited with errors."
- rc=$OCF_ERR_GENERIC
-
- elif [ -n "${queues}" ]; then
- local q_c
- q_c=`printf %b "${queues}\n" | wc -l`
- local mem
- mem=`printf %b "${queues}\n" | awk -v sum=0 '{sum+=$1} END {print (sum/1048576)}'`
- local mes
- mes=`printf %b "${queues}\n" | awk -v sum=0 '{sum+=$2} END {print sum}'`
- local c_u
- c_u=`printf %b "${queues}\n" | awk -v sum=0 -v cnt=${q_c} '{sum+=$3} END {print (sum+1)/(cnt+1)}'`
- local status
- status=`echo $(su_rabbit_cmd "${OCF_RESKEY_ctl} -q status")`
- ocf_log info "${LH} RabbitMQ is running ${q_c} queues consuming ${mem}m of ${TOTALVMEM}m total, with ${mes} queued messages, average consumer utilization ${c_u}"
- ocf_log info "${LH} RabbitMQ status: ${status}"
- fi
- fi
-
- return $rc
-}
-
-ocf_get_private_attr() {
- local attr_name="${1:?}"
- local attr_default_value="${2:?}"
- local nodename="${3:-$THIS_PCMK_NODE}"
- local count
- count=$(attrd_updater -p --name "$attr_name" --node "$nodename" --query)
- if [ $? -ne 0 ]; then
- echo $attr_default_value
- else
- echo "$count" | awk -vdef_val="$attr_default_value" '{ gsub(/"/, "", $3); split($3, vals, "="); if (vals[2] != "") print vals[2]; else print def_val }'
- fi
-}
-
-ocf_update_private_attr() {
- local attr_name="${1:?}"
- local attr_value="${2:?}"
- local nodename="${3:-$THIS_PCMK_NODE}"
- ocf_run attrd_updater -p --name "$attr_name" --node "$nodename" --update "$attr_value"
-}
-
-rabbitmqctl_with_timeout_check() {
- local command="${1:?}"
- local timeout_attr_name="${2:?}"
-
- su_rabbit_cmd "${OCF_RESKEY_ctl} $command"
- local rc=$?
-
- check_timeouts $rc $timeout_attr_name "$command"
- local has_timed_out=$?
-
- case "$has_timed_out" in
- 0)
- return $rc;;
- 1)
- return 0;;
- 2)
- return 1;;
- esac
-}
-
-is_cluster_status_ok() {
- local LH="${LH}: is_cluster_status_ok:"
- rabbitmqctl_with_timeout_check cluster_status rabbit_cluster_status_timeouts > /dev/null 2>&1
-}
-
-action_monitor() {
- local rc=$OCF_ERR_GENERIC
- local LH="${LL} monitor:"
- ocf_log debug "${LH} action start."
- if [ "${OCF_RESKEY_debug}" = 'true' ] ; then
- d=`date '+%Y%m%d %H:%M:%S'`
- echo $d >> /tmp/rmq-monitor.log
- env >> /tmp/rmq-monitor.log
- echo "$d [monitor] start='${OCF_RESKEY_CRM_meta_notify_start_uname}' stop='${OCF_RESKEY_CRM_meta_notify_stop_uname}' active='${OCF_RESKEY_CRM_meta_notify_active_uname}' inactive='${OCF_RESKEY_CRM_meta_notify_inactive_uname}'" >> /tmp/rmq-ocf.log
- fi
- get_monitor
- rc=$?
- ocf_log debug "${LH} role: ${OCF_RESKEY_CRM_meta_role}"
- ocf_log debug "${LH} result: $rc"
- ocf_log debug "${LH} action end."
- return $rc
-}
-
-
-action_start() {
- local rc=$OCF_ERR_GENERIC
- local LH="${LL} start:"
- local nowtime
-
- if [ "${OCF_RESKEY_debug}" = 'true' ] ; then
- d=`date '+%Y%m%d %H:%M:%S'`
- echo $d >> /tmp/rmq-start.log
- env >> /tmp/rmq-start.log
- echo "$d [start] start='${OCF_RESKEY_CRM_meta_notify_start_uname}' stop='${OCF_RESKEY_CRM_meta_notify_stop_uname}' active='${OCF_RESKEY_CRM_meta_notify_active_uname}' inactive='${OCF_RESKEY_CRM_meta_notify_inactive_uname}'" >> /tmp/rmq-ocf.log
- fi
-
- ocf_log info "${LH} action begin."
-
- get_status
- rc=$?
- if [ $rc -eq $OCF_SUCCESS ] ; then
- ocf_log warn "${LH} RMQ-runtime (beam) already started."
- return $OCF_SUCCESS
- fi
-
- local attrs_to_zero="rabbit_list_channels_timeouts rabbit_get_alarms_timeouts rabbit_list_queues_timeouts rabbit_cluster_status_timeouts rabbit_node_health_check_timeouts"
- local attr_name_to_reset
- for attr_name_to_reset in $attrs_to_zero; do
- ocf_update_private_attr $attr_name_to_reset 0
- done
-
- nowtime=$(now)
- ocf_log info "${LH} Setting phase 1 one start time to $nowtime"
- ocf_update_private_attr 'rabbit-start-phase-1-time' "$nowtime"
- ocf_log info "${LH} Deleting start time attribute"
- ocf_run crm_attribute -N $THIS_PCMK_NODE -l reboot --name 'rabbit-start-time' --delete
- ocf_log info "${LH} Deleting master attribute"
- ocf_run crm_attribute -N $THIS_PCMK_NODE -l reboot --name 'rabbit-master' --delete
-
- ocf_log info "${LH} RMQ going to start."
- start_rmq_server_app
- rc=$?
- if [ $rc -eq $OCF_SUCCESS ] ; then
- ocf_log info "${LH} RMQ prepared for start succesfully."
- fi
-
- ocf_log info "${LH} action end."
- return $rc
-}
-
-
-action_stop() {
- local rc=$OCF_ERR_GENERIC
- local LH="${LL} stop:"
-
- if [ "${OCF_RESKEY_debug}" = 'true' ] ; then
- d=$(date '+%Y%m%d %H:%M:%S')
- echo $d >> /tmp/rmq-stop.log
- env >> /tmp/rmq-stop.log
- echo "$d [stop] start='${OCF_RESKEY_CRM_meta_notify_start_uname}' stop='${OCF_RESKEY_CRM_meta_notify_stop_uname}' active='${OCF_RESKEY_CRM_meta_notify_active_uname}' inactive='${OCF_RESKEY_CRM_meta_notify_inactive_uname}'" >> /tmp/rmq-ocf.log
- fi
-
- ocf_log info "${LH} action begin."
-
- ocf_log info "${LH} Deleting master attribute"
- ocf_run crm_attribute -N $THIS_PCMK_NODE -l reboot --name 'rabbit-master' --delete
- master_score 0
- ocf_log info "${LH} Deleting start time attribute"
- ocf_run crm_attribute -N $THIS_PCMK_NODE -l reboot --name 'rabbit-start-time' --delete
-
- # Wait for synced state first
- ocf_log info "${LH} waiting $((OCF_RESKEY_stop_time/2)) to sync"
- wait_sync $((OCF_RESKEY_stop_time/2))
-
- ocf_log info "${LH} RMQ-runtime (beam) going to down."
- stop_server_process
- # Fail early without additional rabbitmqctl invocations
- if [ $? -ne $OCF_SUCCESS ] ; then
- ocf_log err "RMQ-runtime (beam) couldn't be stopped and will likely became unmanaged. Take care of it manually!"
- ocf_log info "${LH} action end."
- exit $OCF_ERR_GENERIC
- fi
-
- # Ensure the actual status to be returned
- get_status
- if [ $? -eq $OCF_NOT_RUNNING ] ; then
- ocf_log info "${LH} RMQ-runtime (beam) not running."
- ocf_log info "${LH} action end."
- return $OCF_SUCCESS
- else
- ocf_log err "RMQ-runtime (beam) couldn't be stopped and will likely became unmanaged. Take care of it manually!"
- ocf_log info "${LH} action end."
- exit $OCF_ERR_GENERIC
- fi
-
-}
-
-#######################################################################
-# Enhanced list_channels:
-# - nodes are processed in parallel
-# - report contains information about which nodes timed out
-#
-# 'list_channels' is used as a healh-check for current node, but it
-# actually checks overall health of all node in cluster. And there were
-# some bugs where only one (non-local) channel became stuck, but OCF
-# script was wrongfully killing local node.
-#
-# Hopefully all such bugs are fixed, but if not - it will allow to
-# detect such conditions.
-#
-# Somewhat strange implementation is due to the following reasons:
-# - ability to support older versions of RabbitMQ which have reached
-# end-of-life with single version of the script
-# - zero dependencies - for older versions this functionality could be
-# implemented as a plugin, but it'll require this plugin installation
-enhanced_list_channels() {
- # One second less than timeout of su_rabbit_cmd
- local timeout=$((${TIMEOUT_ARG:-5} - 1))
-
- su_rabbit_cmd "xargs -0 ${OCF_RESKEY_ctl} eval" <<EOF
-SecondsToCompletion = $timeout,
-
-%% Milliseconds since unix epoch
-Now = fun() ->
- {Mega, Secs, Micro} = os:timestamp(),
- Mili = Micro div 1000,
- Mili + 1000 * (Secs + 1000000 * Mega)
- end,
-
-%% We shouldn't continue execution past this time
-ShouldEndAt = Now() + SecondsToCompletion * 1000,
-
-%% How many milliseconds we still have
-Timeout = fun() ->
- case ShouldEndAt - Now() of
- Past when Past =< 0 ->
- 0;
- Timeout ->
- Timeout
- end
- end,
-
-%% Lambda combinator - for defining anonymous recursive functions
-Y = fun(F) ->
- (fun (X) -> F(fun(Y) -> (X(X))(Y) end) end)(
- fun (X) -> F(fun(Y) -> (X(X))(Y) end) end)
- end,
-
-Parent = self(),
-
-ListChannels = Y(fun(Rec) ->
- fun (({Node, [], OkChannelsCount})) ->
- Parent ! {Node, ok, OkChannelsCount};
- ({Node, [Chan|Rest], OkChannelsCount}) ->
- case catch rpc:call(Node, rabbit_channel, info, [Chan], Timeout()) of
- Infos when is_list(Infos) ->
- Rec({Node, Rest, OkChannelsCount + 1});
- {badrpc, {'EXIT', {noproc, _}}} ->
- %% Channel became dead before we could request it's status, don't care
- Rec({Node, Rest, OkChannelsCount});
- Err ->
- Parent ! {Node, Err, OkChannelsCount}
- end
- end
- end),
-
-SingleNodeListing = fun(Node) ->
- case catch rpc:call(Node, pg_local, get_members, [rabbit_channels], Timeout()) of
- LocalChannels when is_list(LocalChannels) ->
- ListChannels({Node, LocalChannels, 0});
- Err ->
- Parent ! {Node, Err, 0}
- end
- end,
-
-AllNodes = rabbit_mnesia:cluster_nodes(running),
-[ spawn(fun() -> SingleNodeListing(Node) end) || Node <- AllNodes ],
-
-WaitForNodes = Y(fun(Rec) ->
- fun ({[], Acc}) ->
- Acc;
- ({RemainingNodes, Acc}) ->
- receive
- {Node, _Status, _ChannelCount} = Smth ->
- RemainingNodes1 = lists:delete(Node, RemainingNodes),
- Rec({RemainingNodes1, [Smth|Acc]})
- after Timeout() + 100 ->
- Acc
- end
- end
- end),
-
-Result = WaitForNodes({AllNodes, []}),
-
-ExpandedResult = [ case lists:keysearch(Node, 1, Result) of
- {value, NodeResult} ->
- NodeResult;
- false ->
- {Node, no_data_collected, 0}
- end || Node <- AllNodes ],
-
-ExpandedResult.
-EOF
-}
-
-#######################################################################
-# Join the cluster and return OCF_SUCCESS, if joined.
-# Return 10, if node is trying to join to itself or empty destination.
-# Return OCF_ERR_GENERIC, if cannot join.
-jjj_join () {
- local join_to="$1"
- local rc=$OCF_ERR_GENERIC
- local LH="${LL} jjj_join:"
-
- my_host ${join_to}
- rc=$?
- ocf_log debug "${LH} node='${join_to}' rc='${rc}'"
-
- # Check whether we are joining to ourselves
- # or master host is not given
- if [ $rc -ne 0 -a "${join_to}" ] ; then
- ocf_log info "${LH} Joining to cluster by node '${join_to}'"
- join_to_cluster "${join_to}"
- rc=$?
- if [ $rc -ne $OCF_SUCCESS ] ; then
- ocf_log err "${LH} Failed to join the cluster. The mnesia will be reset."
- reset_mnesia
- rc=$OCF_ERR_GENERIC
- fi
- fi
- return $rc
-}
-
-action_notify() {
- local rc_join=$OCF_SUCCESS
- local rc=$OCF_ERR_GENERIC
- local rc2=$OCF_ERR_GENERIC
- local LH="${LL} notify:"
- local nodelist
-
- if [ "${OCF_RESKEY_debug}" = 'true' ] ; then
- d=`date '+%Y%m%d %H:%M:%S'`
- echo $d >> /tmp/rmq-notify.log
- env >> /tmp/rmq-notify.log
- echo "$d [notify] ${OCF_RESKEY_CRM_meta_notify_type}-${OCF_RESKEY_CRM_meta_notify_operation} promote='${OCF_RESKEY_CRM_meta_notify_promote_uname}' demote='${OCF_RESKEY_CRM_meta_notify_demote_uname}' master='${OCF_RESKEY_CRM_meta_notify_master_uname}' slave='${OCF_RESKEY_CRM_meta_notify_slave_uname}' start='${OCF_RESKEY_CRM_meta_notify_start_uname}' stop='${OCF_RESKEY_CRM_meta_notify_stop_uname}' active='${OCF_RESKEY_CRM_meta_notify_active_uname}' inactive='${OCF_RESKEY_CRM_meta_notify_inactive_uname}'" >> /tmp/rmq-ocf.log
- fi
-
- if [ "${OCF_RESKEY_CRM_meta_notify_type}" = 'post' ] ; then
- # POST- anything notify section
- case "$OCF_RESKEY_CRM_meta_notify_operation" in
- promote)
- ocf_log info "${LH} post-promote begin."
-
- rc=$OCF_SUCCESS
-
- # Do nothing, if the list of nodes being promoted reported empty.
- # Delegate recovery, if needed, to the "running out of the cluster" monitor's logic
- if [ -z "${OCF_RESKEY_CRM_meta_notify_promote_uname}" ] ; then
- ocf_log warn "${LH} there are no nodes to join to reported on post-promote. Nothing to do."
-
- elif my_host "${OCF_RESKEY_CRM_meta_notify_promote_uname}"; then
- ocf_log info "${LH} ignoring post-promote of self"
-
- elif is_clustered_with "${OCF_RESKEY_CRM_meta_notify_promote_uname}"; then
- if get_status rabbit; then
- ocf_log info "${LH} we are already clustered with master - ${OCF_RESKEY_CRM_meta_notify_promote_uname}. Nothing to do."
- else
- ocf_log info "${LH} we are already clustered with master - ${OCF_RESKEY_CRM_meta_notify_promote_uname}. We only need to start the app."
-
- try_to_start_rmq_app
- rc2=$?
- update_rabbit_start_time_if_rc $rc2
- fi
-
- else
- # Note, this should fail when the mnesia is inconsistent.
- # For example, when the "old" master processing the promition of the new one.
- # Later this ex-master node will rejoin the cluster at post-start.
- jjj_join "${OCF_RESKEY_CRM_meta_notify_promote_uname}"
- rc=$?
- if [ $rc -eq $OCF_ERR_GENERIC ] ; then
- ocf_log err "${LH} Failed to join the cluster on post-promote. The resource will be restarted."
- fi
- fi
-
- ocf_log info "${LH} post-promote end."
- return $rc
- ;;
- start)
- ocf_log info "${LH} post-start begin."
- local nodes_list="${OCF_RESKEY_CRM_meta_notify_start_uname} ${OCF_RESKEY_CRM_meta_notify_active_uname}"
- # Do nothing, if the list of nodes being started or running reported empty
- # Delegate recovery, if needed, to the "running out of the cluster" monitor's logic
- if [ -z "${nodes_list}" ] ; then
- ocf_log warn "${LH} I'm a last man standing and I must survive!"
- ocf_log info "${LH} post-start end."
- return $OCF_SUCCESS
- fi
- # check did this event from this host
- my_host "${nodes_list}"
- rc=$?
- # Do nothing, if there is no master reported
- # Delegate recovery, if needed, to the "running out of the cluster" monitor's logic
- if [ -z "${OCF_RESKEY_CRM_meta_notify_master_uname}" ] ; then
- ocf_log warn "${LH} there are no nodes to join to reported on post-start. Nothing to do."
- ocf_log info "${LH} post-start end."
- return $OCF_SUCCESS
- fi
- if [ $rc -eq $OCF_SUCCESS ] ; then
- # Now we need to:
- # a. join to the cluster if we are not joined yet
- # b. start the RabbitMQ application, which is always
- # stopped after start action finishes
- check_need_join_to ${OCF_RESKEY_CRM_meta_notify_master_uname}
- rc_join=$?
- if [ $rc_join -eq $OCF_SUCCESS ]; then
- ocf_log warn "${LH} Going to join node ${OCF_RESKEY_CRM_meta_notify_master_uname}"
- jjj_join "${OCF_RESKEY_CRM_meta_notify_master_uname}"
- rc2=$?
- else
- ocf_log warn "${LH} We are already clustered with node ${OCF_RESKEY_CRM_meta_notify_master_uname}"
-
- try_to_start_rmq_app
- rc2=$?
- update_rabbit_start_time_if_rc $rc2
- fi
- ocf_log info "${LH} post-start end."
- if [ -s "${OCF_RESKEY_definitions_dump_file}" ] ; then
- ocf_log info "File ${OCF_RESKEY_definitions_dump_file} exists"
- ocf_run curl --silent --show-error --request POST --user $OCF_RESKEY_admin_user:$OCF_RESKEY_admin_password $OCF_RESKEY_host_ip:15672/api/definitions --header "Content-Type:application/json" --data @$OCF_RESKEY_definitions_dump_file
- rc=$?
- if [ $rc -eq $OCF_SUCCESS ] ; then
- ocf_log info "RMQ definitions have imported succesfully."
- else
- ocf_log err "RMQ definitions have not imported."
- fi
- fi
- if [ $rc2 -eq $OCF_ERR_GENERIC ] ; then
- ocf_log warn "${LH} Failed to join the cluster on post-start. The resource will be restarted."
- ocf_log info "${LH} post-start end."
- return $OCF_ERR_GENERIC
- fi
- fi
- ;;
- stop)
- # if rabbitmq-server stops on any another node, we should remove it from cluster (as ordinary operation)
- ocf_log info "${LH} post-stop begin."
- # Report not running, if there are no nodes being stopped reported
- if [ -z "${OCF_RESKEY_CRM_meta_notify_stop_uname}" ] ; then
- ocf_log warn "${LH} there are no nodes being stopped reported on post-stop. The resource will be restarted."
- ocf_log info "${LH} post-stop end."
- return $OCF_ERR_GENERIC
- fi
- my_host "${OCF_RESKEY_CRM_meta_notify_stop_uname}"
- rc=$?
- if [ $rc -ne $OCF_SUCCESS ] ; then
- # Wait for synced state first
- ocf_log info "${LH} waiting $((OCF_RESKEY_stop_time/2)) to sync"
- wait_sync $((OCF_RESKEY_stop_time/2))
- # On other nodes processing the post-stop, make sure the stopped node will be forgotten
- unjoin_nodes_from_cluster "${OCF_RESKEY_CRM_meta_notify_stop_uname}"
- else
- # On the nodes being stopped, reset the master score
- ocf_log info "${LH} resetting the master score."
- master_score 0
- fi
- # always returns OCF_SUCCESS
- ocf_log info "${LH} post-stop end."
- ;;
- *) ;;
- esac
- fi
-
- return $OCF_SUCCESS
-}
-
-
-action_promote() {
- local rc=$OCF_ERR_GENERIC
- local LH="${LL} promote:"
-
- if [ "${OCF_RESKEY_debug}" = 'true' ] ; then
- d=$(date '+%Y%m%d %H:%M:%S')
- echo $d >> /tmp/rmq-promote.log
- env >> /tmp/rmq-promote.log
- echo "$d [promote] start='${OCF_RESKEY_CRM_meta_notify_start_uname}' stop='${OCF_RESKEY_CRM_meta_notify_stop_uname}' active='${OCF_RESKEY_CRM_meta_notify_active_uname}' inactive='${OCF_RESKEY_CRM_meta_notify_inactive_uname}'" >> /tmp/rmq-ocf.log
- fi
-
- ocf_log info "${LH} action begin."
-
- get_monitor
- rc=$?
- ocf_log info "${LH} get_monitor returns ${rc}"
- case "$rc" in
- "$OCF_SUCCESS")
- # Running as slave. Normal, expected behavior.
- ocf_log info "${LH} Resource is currently running as Slave"
- # rabbitmqctl start_app if need
- get_status rabbit
- rc=$?
- ocf_log info "${LH} Updating cluster master attribute"
- ocf_run crm_attribute -N $THIS_PCMK_NODE -l reboot --name 'rabbit-master' --update 'true'
- if [ $rc -ne $OCF_SUCCESS ] ; then
- ocf_log info "${LH} RMQ app is not started. Starting..."
- start_rmq_server_app
- rc=$?
- if [ $rc -eq 0 ] ; then
- try_to_start_rmq_app
- rc=$?
- if [ $rc -ne 0 ] ; then
- ocf_log err "${LH} Can't start RMQ app. Master resource is failed."
- ocf_log info "${LH} action end."
- exit $OCF_FAILED_MASTER
- fi
-
- [ -f "${OCF_RESKEY_policy_file}" ] && . "${OCF_RESKEY_policy_file}"
-
- update_rabbit_start_time_if_rc $rc
-
- ocf_log info "${LH} Checking master status"
- get_monitor
- rc=$?
- ocf_log info "${LH} Master status is $rc"
- if [ $rc = $OCF_RUNNING_MASTER ]
- then
- rc=$OCF_SUCCESS
- else
- ocf_log err "${LH} Master resource is failed."
- ocf_log info "${LH} action end."
- exit $OCF_FAILED_MASTER
- fi
- else
- ocf_log err "${LH} Can't start RMQ-runtime."
- rc=$OCF_ERR_GENERIC
- fi
- fi
- return $rc
- ;;
- "$OCF_RUNNING_MASTER")
- # Already a master. Unexpected, but not a problem.
- ocf_log warn "${LH} Resource is already running as Master"
- rc=$OCF_SUCCESS
- ;;
-
- "$OCF_FAILED_MASTER")
- # Master failed.
- ocf_log err "${LH} Master resource is failed and not running"
- ocf_log info "${LH} action end."
- exit $OCF_FAILED_MASTER
- ;;
-
- "$OCF_NOT_RUNNING")
- # Currently not running.
- ocf_log err "${LH} Resource is currently not running"
- rc=$OCF_NOT_RUNNING
- ;;
- *)
- # Failed resource. Let the cluster manager recover.
- ocf_log err "${LH} Unexpected error, cannot promote"
- ocf_log info "${LH} action end."
- exit $rc
- ;;
- esac
-
- # transform slave RMQ-server to master
-
- ocf_log info "${LH} action end."
- return $rc
-}
-
-
-action_demote() {
- local LH="${LL} demote:"
- ocf_log info "${LH} action begin."
- ocf_run crm_attribute -N $THIS_PCMK_NODE -l reboot --name 'rabbit-master' --delete
- ocf_log info "${LH} action end."
- return $OCF_SUCCESS
-}
-#######################################################################
-
-rmq_setup_env
-
-case "$1" in
- meta-data) meta_data
- exit $OCF_SUCCESS;;
- usage|help) usage
- exit $OCF_SUCCESS;;
-esac
-
-# Anything except meta-data and help must pass validation
-action_validate || exit $?
-
-# What kind of method was invoked?
-case "$1" in
- start) action_start;;
- stop) action_stop;;
- status) action_status;;
- monitor) action_monitor;;
- validate) action_validate;;
- promote) action_promote;;
- demote) action_demote;;
- notify) action_notify;;
- validate-all) action_validate;;
- *) usage;;
-esac
-###
diff --git a/scripts/rabbitmq-server.ocf b/scripts/rabbitmq-server.ocf
deleted file mode 100755
index 804e65423d..0000000000
--- a/scripts/rabbitmq-server.ocf
+++ /dev/null
@@ -1,371 +0,0 @@
-#!/bin/sh
-## The contents of this file are subject to the Mozilla Public License
-## Version 1.1 (the "License"); you may not use this file except in
-## compliance with the License. You may obtain a copy of the License
-## at http://www.mozilla.org/MPL/
-##
-## Software distributed under the License is distributed on an "AS IS"
-## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-## the License for the specific language governing rights and
-## limitations under the License.
-##
-## The Original Code is RabbitMQ.
-##
-## The Initial Developer of the Original Code is GoPivotal, Inc.
-## Copyright (c) 2007-2015 Pivotal Software, Inc. All rights reserved.
-##
-
-##
-## OCF Resource Agent compliant rabbitmq-server resource script.
-##
-
-## OCF instance parameters
-## OCF_RESKEY_server
-## OCF_RESKEY_ctl
-## OCF_RESKEY_nodename
-## OCF_RESKEY_ip
-## OCF_RESKEY_port
-## OCF_RESKEY_config_file
-## OCF_RESKEY_log_base
-## OCF_RESKEY_mnesia_base
-## OCF_RESKEY_server_start_args
-## OCF_RESKEY_pid_file
-
-#######################################################################
-# Initialization:
-
-: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/resource.d/heartbeat}
-. ${OCF_FUNCTIONS_DIR}/.ocf-shellfuncs
-
-#######################################################################
-
-OCF_RESKEY_server_default="/usr/sbin/rabbitmq-server"
-OCF_RESKEY_ctl_default="/usr/sbin/rabbitmqctl"
-OCF_RESKEY_nodename_default="rabbit@localhost"
-OCF_RESKEY_log_base_default="/var/log/rabbitmq"
-OCF_RESKEY_pid_file_default="/var/run/rabbitmq/pid"
-: ${OCF_RESKEY_server=${OCF_RESKEY_server_default}}
-: ${OCF_RESKEY_ctl=${OCF_RESKEY_ctl_default}}
-: ${OCF_RESKEY_nodename=${OCF_RESKEY_nodename_default}}
-: ${OCF_RESKEY_log_base=${OCF_RESKEY_log_base_default}}
-: ${OCF_RESKEY_pid_file=${OCF_RESKEY_pid_file_default}}
-
-meta_data() {
- cat <<END
-<?xml version="1.0"?>
-<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
-<resource-agent name="rabbitmq-server">
-<version>1.0</version>
-
-<longdesc lang="en">
-Resource agent for RabbitMQ-server
-</longdesc>
-
-<shortdesc lang="en">Resource agent for RabbitMQ-server</shortdesc>
-
-<parameters>
-<parameter name="server" unique="0" required="0">
-<longdesc lang="en">
-The path to the rabbitmq-server script
-</longdesc>
-<shortdesc lang="en">Path to rabbitmq-server</shortdesc>
-<content type="string" default="${OCF_RESKEY_server_default}" />
-</parameter>
-
-<parameter name="ctl" unique="0" required="0">
-<longdesc lang="en">
-The path to the rabbitmqctl script
-</longdesc>
-<shortdesc lang="en">Path to rabbitmqctl</shortdesc>
-<content type="string" default="${OCF_RESKEY_ctl_default}" />
-</parameter>
-
-<parameter name="nodename" unique="0" required="0">
-<longdesc lang="en">
-The node name for rabbitmq-server
-</longdesc>
-<shortdesc lang="en">Node name</shortdesc>
-<content type="string" default="${OCF_RESKEY_nodename_default}" />
-</parameter>
-
-<parameter name="ip" unique="0" required="0">
-<longdesc lang="en">
-The IP address for rabbitmq-server to listen on
-</longdesc>
-<shortdesc lang="en">IP Address</shortdesc>
-<content type="string" default="" />
-</parameter>
-
-<parameter name="port" unique="0" required="0">
-<longdesc lang="en">
-The IP Port for rabbitmq-server to listen on
-</longdesc>
-<shortdesc lang="en">IP Port</shortdesc>
-<content type="integer" default="" />
-</parameter>
-
-<parameter name="config_file" unique="0" required="0">
-<longdesc lang="en">
-Location of the config file (without the .config suffix)
-</longdesc>
-<shortdesc lang="en">Config file path (without the .config suffix)</shortdesc>
-<content type="string" default="" />
-</parameter>
-
-<parameter name="log_base" unique="0" required="0">
-<longdesc lang="en">
-Location of the directory under which logs will be created
-</longdesc>
-<shortdesc lang="en">Log base path</shortdesc>
-<content type="string" default="${OCF_RESKEY_log_base_default}" />
-</parameter>
-
-<parameter name="mnesia_base" unique="0" required="0">
-<longdesc lang="en">
-Location of the directory under which mnesia will store data
-</longdesc>
-<shortdesc lang="en">Mnesia base path</shortdesc>
-<content type="string" default="" />
-</parameter>
-
-<parameter name="server_start_args" unique="0" required="0">
-<longdesc lang="en">
-Additional arguments provided to the server on startup
-</longdesc>
-<shortdesc lang="en">Server start arguments</shortdesc>
-<content type="string" default="" />
-</parameter>
-
-<parameter name="pid_file" unique="0" required="0">
-<longdesc lang="en">
-Location of the file in which the pid will be stored
-</longdesc>
-<shortdesc lang="en">Pid file path</shortdesc>
-<content type="string" default="${OCF_RESKEY_pid_file_default}" />
-</parameter>
-
-</parameters>
-
-<actions>
-<action name="start" timeout="600" />
-<action name="stop" timeout="120" />
-<action name="status" timeout="20" interval="10" />
-<action name="monitor" timeout="20" interval="10" />
-<action name="validate-all" timeout="30" />
-<action name="meta-data" timeout="5" />
-</actions>
-</resource-agent>
-END
-}
-
-rabbit_usage() {
- cat <<END
-usage: $0 {start|stop|status|monitor|validate-all|meta-data}
-
-Expects to have a fully populated OCF RA-compliant environment set.
-END
-}
-
-RABBITMQ_SERVER=$OCF_RESKEY_server
-RABBITMQ_CTL=$OCF_RESKEY_ctl
-RABBITMQ_NODENAME=$OCF_RESKEY_nodename
-RABBITMQ_NODE_IP_ADDRESS=$OCF_RESKEY_ip
-RABBITMQ_NODE_PORT=$OCF_RESKEY_port
-RABBITMQ_CONFIG_FILE=$OCF_RESKEY_config_file
-RABBITMQ_LOG_BASE=$OCF_RESKEY_log_base
-RABBITMQ_MNESIA_BASE=$OCF_RESKEY_mnesia_base
-RABBITMQ_SERVER_START_ARGS=$OCF_RESKEY_server_start_args
-RABBITMQ_PID_FILE=$OCF_RESKEY_pid_file
-[ ! -z $RABBITMQ_NODENAME ] && NODENAME_ARG="-n $RABBITMQ_NODENAME"
-[ ! -z $RABBITMQ_NODENAME ] && export RABBITMQ_NODENAME
-
-ensure_pid_dir () {
- PID_DIR=`dirname ${RABBITMQ_PID_FILE}`
- if [ ! -d ${PID_DIR} ] ; then
- mkdir -p ${PID_DIR}
- chown -R rabbitmq:rabbitmq ${PID_DIR}
- chmod 755 ${PID_DIR}
- fi
- return $OCF_SUCCESS
-}
-
-remove_pid () {
- rm -f ${RABBITMQ_PID_FILE}
- rmdir `dirname ${RABBITMQ_PID_FILE}` || :
-}
-
-export_vars() {
- [ ! -z $RABBITMQ_NODE_IP_ADDRESS ] && export RABBITMQ_NODE_IP_ADDRESS
- [ ! -z $RABBITMQ_NODE_PORT ] && export RABBITMQ_NODE_PORT
- [ ! -z $RABBITMQ_CONFIG_FILE ] && export RABBITMQ_CONFIG_FILE
- [ ! -z $RABBITMQ_LOG_BASE ] && export RABBITMQ_LOG_BASE
- [ ! -z $RABBITMQ_MNESIA_BASE ] && export RABBITMQ_MNESIA_BASE
- [ ! -z $RABBITMQ_SERVER_START_ARGS ] && export RABBITMQ_SERVER_START_ARGS
- [ ! -z $RABBITMQ_PID_FILE ] && ensure_pid_dir && export RABBITMQ_PID_FILE
-}
-
-rabbit_validate_partial() {
- if [ ! -x $RABBITMQ_SERVER ]; then
- ocf_log err "rabbitmq-server server $RABBITMQ_SERVER does not exist or is not executable";
- exit $OCF_ERR_INSTALLED;
- fi
-
- if [ ! -x $RABBITMQ_CTL ]; then
- ocf_log err "rabbitmq-server ctl $RABBITMQ_CTL does not exist or is not executable";
- exit $OCF_ERR_INSTALLED;
- fi
-}
-
-rabbit_validate_full() {
- if [ ! -z $RABBITMQ_CONFIG_FILE ] && [ ! -e "${RABBITMQ_CONFIG_FILE}.config" ]; then
- ocf_log err "rabbitmq-server config_file ${RABBITMQ_CONFIG_FILE}.config does not exist or is not a file";
- exit $OCF_ERR_INSTALLED;
- fi
-
- if [ ! -z $RABBITMQ_LOG_BASE ] && [ ! -d $RABBITMQ_LOG_BASE ]; then
- ocf_log err "rabbitmq-server log_base $RABBITMQ_LOG_BASE does not exist or is not a directory";
- exit $OCF_ERR_INSTALLED;
- fi
-
- if [ ! -z $RABBITMQ_MNESIA_BASE ] && [ ! -d $RABBITMQ_MNESIA_BASE ]; then
- ocf_log err "rabbitmq-server mnesia_base $RABBITMQ_MNESIA_BASE does not exist or is not a directory";
- exit $OCF_ERR_INSTALLED;
- fi
-
- rabbit_validate_partial
-
- return $OCF_SUCCESS
-}
-
-rabbit_status() {
- rabbitmqctl_action "status"
-}
-
-rabbit_wait() {
- rabbitmqctl_action "wait" $1
-}
-
-rabbitmqctl_action() {
- local rc
- local action
- action=$@
- $RABBITMQ_CTL $NODENAME_ARG $action > /dev/null 2> /dev/null
- rc=$?
- case "$rc" in
- 0)
- ocf_log debug "RabbitMQ server is running normally"
- return $OCF_SUCCESS
- ;;
- 2)
- ocf_log debug "RabbitMQ server is not running"
- return $OCF_NOT_RUNNING
- ;;
- *)
- ocf_log err "Unexpected return from rabbitmqctl $NODENAME_ARG $action: $rc"
- exit $OCF_ERR_GENERIC
- esac
-}
-
-rabbit_start() {
- local rc
-
- if rabbit_status; then
- ocf_log info "Resource already running."
- return $OCF_SUCCESS
- fi
-
- export_vars
-
- setsid sh -c "$RABBITMQ_SERVER > ${RABBITMQ_LOG_BASE}/startup_log 2> ${RABBITMQ_LOG_BASE}/startup_err" &
-
- # Wait for the server to come up.
- # Let the CRM/LRM time us out if required
- rabbit_wait $RABBITMQ_PID_FILE
- rc=$?
- if [ "$rc" != $OCF_SUCCESS ]; then
- remove_pid
- ocf_log info "rabbitmq-server start failed: $rc"
- exit $OCF_ERR_GENERIC
- fi
-
- return $OCF_SUCCESS
-}
-
-rabbit_stop() {
- local rc
-
- if ! rabbit_status; then
- ocf_log info "Resource not running."
- return $OCF_SUCCESS
- fi
-
- $RABBITMQ_CTL stop ${RABBITMQ_PID_FILE}
- rc=$?
-
- if [ "$rc" != 0 ]; then
- ocf_log err "rabbitmq-server stop command failed: $RABBITMQ_CTL stop, $rc"
- return $rc
- fi
-
- # Spin waiting for the server to shut down.
- # Let the CRM/LRM time us out if required
- stop_wait=1
- while [ $stop_wait = 1 ]; do
- rabbit_status
- rc=$?
- if [ "$rc" = $OCF_NOT_RUNNING ]; then
- remove_pid
- stop_wait=0
- break
- elif [ "$rc" != $OCF_SUCCESS ]; then
- ocf_log info "rabbitmq-server stop failed: $rc"
- exit $OCF_ERR_GENERIC
- fi
- sleep 1
- done
-
- return $OCF_SUCCESS
-}
-
-rabbit_monitor() {
- rabbit_status
- return $?
-}
-
-case $__OCF_ACTION in
- meta-data)
- meta_data
- exit $OCF_SUCCESS
- ;;
- usage|help)
- rabbit_usage
- exit $OCF_SUCCESS
- ;;
-esac
-
-if ocf_is_probe; then
- rabbit_validate_partial
-else
- rabbit_validate_full
-fi
-
-case $__OCF_ACTION in
- start)
- rabbit_start
- ;;
- stop)
- rabbit_stop
- ;;
- status|monitor)
- rabbit_monitor
- ;;
- validate-all)
- exit $OCF_SUCCESS
- ;;
- *)
- rabbit_usage
- exit $OCF_ERR_UNIMPLEMENTED
- ;;
-esac
-
-exit $?
diff --git a/scripts/travis_test_ocf_ra.sh b/scripts/travis_test_ocf_ra.sh
deleted file mode 100644
index e8f9a74194..0000000000
--- a/scripts/travis_test_ocf_ra.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh -eux
-# Prepare and run a smoke test against the RabbitMQ OCF RA only if
-# the scripts/rabbitmq-server-ha.ocf has changes
-if ! git diff HEAD~ --name-only | grep -q scripts/rabbitmq-server-ha.ocf
-then
- exit 0
-fi
-
-export VAGRANT_VERSION=1.8.1
-export DOCKER_IMAGE=bogdando/rabbitmq-cluster-ocf-wily
-export UPLOAD_METHOD=none
-export DOCKER_MOUNTS="$(pwd)/scripts/rabbitmq-server-ha.ocf:/tmp/rabbitmq-server-ha"
-
-# Install vagrant and requirements
-sudo apt-get install -qq git wget
-wget --no-verbose https://releases.hashicorp.com/vagrant/${VAGRANT_VERSION}/vagrant_${VAGRANT_VERSION}_x86_64.deb
-sudo dpkg -i --force-all ./vagrant_${VAGRANT_VERSION}_x86_64.deb
-vagrant plugin install vagrant-triggers
-
-# Update docker and prepare images
-sudo apt-get update
-sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install --only-upgrade docker-engine
-sudo service docker restart
-docker pull $DOCKER_IMAGE
-
-# Prepare and run a smoke test for a rabbitmq cluster by the OCF RA
-git clone https://github.com/bogdando/rabbitmq-cluster-ocf-vagrant.git
-cd ./rabbitmq-cluster-ocf-vagrant
-vagrant up --provider docker
-docker exec -it n1 /bin/bash /vagrant/vagrant_script/test_rabbitcluster.sh rabbit@n1 rabbit@n2