summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-06-21 16:22:08 -0700
committerSage Weil <sage@inktank.com>2013-06-21 16:22:08 -0700
commitc1198d680587928b390bb82c87442384331afd40 (patch)
tree87fb4cc1053ac32d7d8bbd3150ff81959dcaa38b
parentde8900dcd079207852b6ce0b51473037be9ae956 (diff)
downloadceph-c1198d680587928b390bb82c87442384331afd40.tar.gz
debian: update postinst, prerm hooks
This syncs up the hooks with the latest master versions. In particular, do not blindly stop/restart daemons on package upgrade! Fixes: #5414 Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--debian/ceph-mds.postinst1
-rw-r--r--debian/ceph-mds.prerm22
-rw-r--r--debian/ceph.postinst1
-rw-r--r--debian/ceph.prerm22
-rw-r--r--debian/radosgw.postinst49
-rw-r--r--debian/radosgw.prerm23
6 files changed, 114 insertions, 4 deletions
diff --git a/debian/ceph-mds.postinst b/debian/ceph-mds.postinst
index 7fcbf5c6230..66b3b5fc2d7 100644
--- a/debian/ceph-mds.postinst
+++ b/debian/ceph-mds.postinst
@@ -1,4 +1,5 @@
#!/bin/sh
+# vim: set noet ts=8:
# postinst script for ceph-mds
#
# see: dh_installdeb(1)
diff --git a/debian/ceph-mds.prerm b/debian/ceph-mds.prerm
index c4af0994d94..654518a7d55 100644
--- a/debian/ceph-mds.prerm
+++ b/debian/ceph-mds.prerm
@@ -1,5 +1,23 @@
#!/bin/sh
+# vim: set noet ts=8:
-[ -x /sbin/stop ] && stop ceph-mds-all || :
+set -e
-exit 0 \ No newline at end of file
+case "$1" in
+ remove)
+ [ -x /sbin/stop ] && stop ceph-mds-all || :
+ invoke-rc.d ceph stop mds || {
+ RESULT=$?
+ if [ $RESULT != 100 ]; then
+ exit $RESULT
+ fi
+ }
+ ;;
+
+ *)
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/ceph.postinst b/debian/ceph.postinst
index 090a91aa9bb..5d64f640b99 100644
--- a/debian/ceph.postinst
+++ b/debian/ceph.postinst
@@ -1,4 +1,5 @@
#!/bin/sh
+# vim: set noet ts=8:
# postinst script for ceph
#
# see: dh_installdeb(1)
diff --git a/debian/ceph.prerm b/debian/ceph.prerm
index 557a1dbdac0..bfd7d3d6fb2 100644
--- a/debian/ceph.prerm
+++ b/debian/ceph.prerm
@@ -1,5 +1,23 @@
#!/bin/sh
+# vim: set noet ts=8:
-[ -x /sbin/stop ] && stop ceph-all || :
+set -e
-exit 0 \ No newline at end of file
+case "$1" in
+ remove)
+ [ -x /sbin/stop ] && stop ceph-all || true
+ invoke-rc.d ceph stop || {
+ RESULT=$?
+ if [ $RESULT != 100 ]; then
+ exit $RESULT
+ fi
+ }
+ ;;
+
+ *)
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/radosgw.postinst b/debian/radosgw.postinst
new file mode 100644
index 00000000000..f3468bc60bf
--- /dev/null
+++ b/debian/radosgw.postinst
@@ -0,0 +1,49 @@
+#!/bin/sh
+# vim: set noet ts=8:
+# postinst script for radosgw
+#
+# 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>]
+#
+# The current action is to simply remove the mistakenly-added
+# /etc/init/ceph.conf file; this could be done in any of these cases,
+# although technically it will leave the system in a different state
+# than the original install that included that file. So instead we
+# only remove on "configure", since that's the only time we know we're
+# successful in installing a newer package than the erroneous version.
+
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ configure)
+ [ -x /sbin/start ] && start radosgw-all || :
+ ;;
+ 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/debian/radosgw.prerm b/debian/radosgw.prerm
new file mode 100644
index 00000000000..4120fb6272c
--- /dev/null
+++ b/debian/radosgw.prerm
@@ -0,0 +1,23 @@
+#!/bin/sh
+# vim: set noet ts=8:
+
+set -e
+
+case "$1" in
+ remove)
+ [ -x /sbin/stop ] && stop radosgw-all || true
+ invoke-rc.d radosgw stop || {
+ RESULT=$?
+ if [ $RESULT != 100 ]; then
+ exit $RESULT
+ fi
+ }
+ ;;
+
+ *)
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0