diff options
| author | Simon MacMullen <simon@lshift.net> | 2008-11-27 18:16:48 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@lshift.net> | 2008-11-27 18:16:48 +0000 |
| commit | b634e8dc8853094cd2f5ab1e351084aaea56c9a5 (patch) | |
| tree | 02cfb5c0498839192a4d01998971f7017ad8c041 | |
| parent | b88d3800b3feed256b721c6864019f0a0d4d4009 (diff) | |
| download | rabbitmq-server-git-b634e8dc8853094cd2f5ab1e351084aaea56c9a5.tar.gz | |
Add some debconf questions so that an upgrade stands a chance of not
breaking. Note that although the documentation suggests this should go
in a separate "config" file if we do that then it tries to bring up the
server first THEN configure the package...
| -rw-r--r-- | packaging/debs/Debian/debian/control | 2 | ||||
| -rw-r--r-- | packaging/debs/Debian/debian/postinst | 22 | ||||
| -rw-r--r-- | packaging/debs/Debian/debian/templates | 19 |
3 files changed, 42 insertions, 1 deletions
diff --git a/packaging/debs/Debian/debian/control b/packaging/debs/Debian/debian/control index 749791a4bd..a0d858be6c 100644 --- a/packaging/debs/Debian/debian/control +++ b/packaging/debs/Debian/debian/control @@ -7,7 +7,7 @@ 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/postinst b/packaging/debs/Debian/debian/postinst index f92131d0c8..94b6e727ac 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-update-needed ; 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/templates b/packaging/debs/Debian/debian/templates new file mode 100644 index 0000000000..3f87a0b41b --- /dev/null +++ b/packaging/debs/Debian/debian/templates @@ -0,0 +1,19 @@ +Template: rabbitmq-server/mnesia-dir-note +Type: note +Description: Mnesia schema changed + The Mnesia schema has changed. Under most circumstances it is safe to remove + the Mnesia directory and start again. However, if you ... or ... you would + need to ... + +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: Delete the Mnesia directory? + +Template: rabbitmq-server/move-mnesia-dir-where +Type: string +Default: /var/lib/rabbitmq/mnesia-old/ +Description: New location for Mnesia directory? + Where do you want to move it? + |
