summaryrefslogtreecommitdiff
path: root/packaging/debs
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@lshift.net>2008-12-05 09:31:03 +0000
committerMatthias Radestock <matthias@lshift.net>2008-12-05 09:31:03 +0000
commitdafac6b5b795d388b67cca7743e2d0d3a7d698ea (patch)
tree55213ac76a9b152ebc012cc5fe65d8a5d3596a0a /packaging/debs
parentb81de62c0f32ee685ce662a29fa53e8421eff494 (diff)
parentb86b36403118cb3ade913af785b2533e3e762984 (diff)
downloadrabbitmq-server-git-dafac6b5b795d388b67cca7743e2d0d3a7d698ea.tar.gz
merge default into bug19900
Diffstat (limited to 'packaging/debs')
-rw-r--r--packaging/debs/Debian/debian/control4
-rw-r--r--packaging/debs/Debian/debian/dirs1
-rw-r--r--packaging/debs/Debian/debian/init.d4
-rw-r--r--packaging/debs/Debian/debian/postinst22
-rw-r--r--packaging/debs/Debian/debian/rabbitmqctl_wrapper9
-rw-r--r--packaging/debs/Debian/debian/rules9
-rw-r--r--packaging/debs/Debian/debian/templates16
7 files changed, 55 insertions, 10 deletions
diff --git a/packaging/debs/Debian/debian/control b/packaging/debs/Debian/debian/control
index 749791a4bd..f6761713dd 100644
--- a/packaging/debs/Debian/debian/control
+++ b/packaging/debs/Debian/debian/control
@@ -2,12 +2,12 @@ Source: rabbitmq-server
Section: net
Priority: extra
Maintainer: Tony Garnock-Jones <tonyg@rabbitmq.com>
-Build-Depends: cdbs, debhelper (>= 5), erlang-nox, erlang-dev, python-json
+Build-Depends: cdbs, debhelper (>= 5), erlang-nox, erlang-dev, python-simplejson
Standards-Version: 3.7.2
Package: rabbitmq-server
Architecture: all
-Depends: erlang-nox, adduser, logrotate
+Depends: erlang-nox, adduser, logrotate, debconf
Description: An AMQP server written in Erlang
RabbitMQ is an implementation of AMQP, the emerging standard for high
performance enterprise messaging. The RabbitMQ server is a robust and
diff --git a/packaging/debs/Debian/debian/dirs b/packaging/debs/Debian/debian/dirs
index 74f8631437..1a707bc191 100644
--- a/packaging/debs/Debian/debian/dirs
+++ b/packaging/debs/Debian/debian/dirs
@@ -1,3 +1,4 @@
+usr/lib/rabbitmq/bin
usr/lib/erlang/lib
usr/sbin
usr/share/man
diff --git a/packaging/debs/Debian/debian/init.d b/packaging/debs/Debian/debian/init.d
index a93f306692..ace474c59f 100644
--- a/packaging/debs/Debian/debian/init.d
+++ b/packaging/debs/Debian/debian/init.d
@@ -10,7 +10,7 @@
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=/usr/sbin/rabbitmq-multi
+DAEMON=/usr/lib/rabbitmq/bin/rabbitmq-multi
NAME=rabbitmq-server
DESC=rabbitmq-server
USER=rabbitmq
@@ -51,7 +51,7 @@ start_rabbitmq () {
stop_rabbitmq () {
set +e
status_rabbitmq quiet
- if [ $RETVAL == 0 ] ; then
+ if [ $RETVAL = 0 ] ; then
su $USER -s /bin/sh -c "$DAEMON stop_all" > /var/log/rabbitmq/shutdown_log 2> /var/log/rabbitmq/shutdown_err
RETVAL=$?
if [ $RETVAL != 0 ] ; then
diff --git a/packaging/debs/Debian/debian/postinst b/packaging/debs/Debian/debian/postinst
index f92131d0c8..13d8552f3d 100644
--- a/packaging/debs/Debian/debian/postinst
+++ b/packaging/debs/Debian/debian/postinst
@@ -34,6 +34,28 @@ chown -R rabbitmq:rabbitmq /var/log/rabbitmq
case "$1" in
configure)
+ . /usr/share/debconf/confmodule
+
+ if ! su rabbitmq -s /bin/sh -c /usr/lib/rabbitmq/bin/rabbitmq-mnesia-current ; then
+ db_beginblock
+ db_input high rabbitmq-server/mnesia-dir-note || true
+ db_input high rabbitmq-server/do-what-with-mnesia-dir || true
+ db_endblock
+ db_go
+
+ db_get rabbitmq-server/do-what-with-mnesia-dir
+ if [ "$RET" = "Delete it" ]; then
+ rm -r /var/lib/rabbitmq/mnesia/
+ elif [ "$RET" = "Move it elsewhere" ]; then
+ db_input high rabbitmq-server/move-mnesia-dir-where || true
+ db_go
+
+ db_get rabbitmq-server/move-mnesia-dir-where
+
+ mkdir -p "`dirname $RET`"
+ mv /var/lib/rabbitmq/mnesia "$RET"
+ fi
+ fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
diff --git a/packaging/debs/Debian/debian/rabbitmqctl_wrapper b/packaging/debs/Debian/debian/rabbitmqctl_wrapper
index c484bb27ea..774731fc9e 100644
--- a/packaging/debs/Debian/debian/rabbitmqctl_wrapper
+++ b/packaging/debs/Debian/debian/rabbitmqctl_wrapper
@@ -10,5 +10,12 @@ for arg in "$@" ; do
done
cd /
-su rabbitmq -s /bin/sh -c "/usr/sbin/rabbitmqctl_real ${CMDLINE}"
+
+if [ ${UID} = 0 ] ; then
+ su rabbitmq -s /bin/sh -c "/usr/lib/rabbitmq/bin/rabbitmqctl ${CMDLINE}"
+else
+ /usr/lib/rabbitmq/bin/rabbitmqctl
+ echo -e "\nOnly root should run rabbitmqctl\n"
+ exit 1
+fi
diff --git a/packaging/debs/Debian/debian/rules b/packaging/debs/Debian/debian/rules
index 39af711c13..fa4cb855cc 100644
--- a/packaging/debs/Debian/debian/rules
+++ b/packaging/debs/Debian/debian/rules
@@ -3,17 +3,16 @@
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/makefile.mk
-RABBIT_LIB=$(DEB_DESTDIR)usr/lib/erlang/lib/rabbitmq_server-$(DEB_UPSTREAM_VERSION)
+RABBIT_LIB=$(DEB_DESTDIR)usr/lib/erlang/lib/rabbitmq_server-$(DEB_UPSTREAM_VERSION)/
+RABBIT_BIN=$(DEB_DESTDIR)usr/lib/rabbitmq/bin/
-DEB_MAKE_INSTALL_TARGET := install TARGET_DIR=$(RABBIT_LIB)/ SBIN_DIR=$(DEB_DESTDIR)usr/sbin MAN_DIR=$(DEB_DESTDIR)usr/share/man
+DEB_MAKE_INSTALL_TARGET := install TARGET_DIR=$(RABBIT_LIB) SBIN_DIR=$(RABBIT_BIN) MAN_DIR=$(DEB_DESTDIR)usr/share/man/
DOCDIR=$(DEB_DESTDIR)usr/share/doc/rabbitmq-server/
install/rabbitmq-server::
mkdir -p $(DOCDIR)
- rm $(RABBIT_LIB)/LICENSE*
- mv $(DEB_DESTDIR)usr/sbin/rabbitmqctl $(DEB_DESTDIR)usr/sbin/rabbitmqctl_real
+ rm $(RABBIT_LIB)LICENSE*
cp debian/rabbitmqctl_wrapper $(DEB_DESTDIR)usr/sbin/rabbitmqctl
cp debian/rabbitmq-server.logrotate $(DEB_DESTDIR)etc/logrotate.d/rabbitmq-server
- cp $(DEB_DESTDIR)usr/share/man/man1/rabbitmqctl.1.gz $(DEB_DESTDIR)usr/share/man/man1/rabbitmqctl_real.1.gz
chmod a+x $(DEB_DESTDIR)usr/sbin/rabbitmqctl
diff --git a/packaging/debs/Debian/debian/templates b/packaging/debs/Debian/debian/templates
new file mode 100644
index 0000000000..89f5754bd7
--- /dev/null
+++ b/packaging/debs/Debian/debian/templates
@@ -0,0 +1,16 @@
+Template: rabbitmq-server/mnesia-dir-note
+Type: note
+Description: Schema changed
+ The RabbitMQ database schema has changed. If your RabbitMQ database contains important data, such as user accounts, durable exchanges and queues, or persistent messages, then we recommend you contact support@rabbitmq.com for assistance with the upgrade. If you want to experiment with the new version in the meantime, simply move the database directory to a safe place. In all other cases just remove the directory.
+
+
+Template: rabbitmq-server/do-what-with-mnesia-dir
+Type: select
+Choices: Delete it, Move it elsewhere, Keep it in place (WILL BREAK)
+Default: Delete it
+Description: What do you want to do with the RabbitMQ database directory?
+
+Template: rabbitmq-server/move-mnesia-dir-where
+Type: string
+Default: /var/lib/rabbitmq/mnesia-old/
+Description: Where do you want to move the RabbitMQ database directory?