From 0cdf3bc875447c87fdc0fed29831554277a3774b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 15 Apr 2016 11:46:56 -0400 Subject: [PATCH] debian: start ceph-mon-all and ceph-osd-all on package install This matches ceph-mds-all and ceph-all behavior. Fixes: http://tracker.ceph.com/issues/15098 Signed-off-by: Sage Weil --- debian/ceph-mon.postinst | 45 ++++++++++++++++++++++++++++++++++++++++ debian/ceph-mon.prerm | 23 ++++++++++++++++++++ debian/ceph-osd.postinst | 45 ++++++++++++++++++++++++++++++++++++++++ debian/ceph-osd.prerm | 23 ++++++++++++++++++++ 4 files changed, 136 insertions(+) create mode 100644 debian/ceph-mon.postinst create mode 100644 debian/ceph-mon.prerm create mode 100644 debian/ceph-osd.postinst create mode 100644 debian/ceph-osd.prerm diff --git a/debian/ceph-mon.postinst b/debian/ceph-mon.postinst new file mode 100644 index 00000000000..b33f34b6b5e --- /dev/null +++ b/debian/ceph-mon.postinst @@ -0,0 +1,45 @@ +# vim: set noet ts=8: +# postinst script for ceph-mon +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# +# postinst configure +# old-postinst abort-upgrade +# conflictor's-postinst abort-remove in-favour +# postinst abort-remove +# deconfigured's-postinst abort-deconfigure in-favour [ ] +# + +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +[ -f "/etc/default/ceph" ] && . /etc/default/ceph +[ -z "$SERVER_USER" ] && SERVER_USER=ceph +[ -z "$SERVER_GROUP" ] && SERVER_GROUP=ceph + +case "$1" in + configure) + [ -x /sbin/start ] && start ceph-mon-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/ceph-mon.prerm b/debian/ceph-mon.prerm new file mode 100644 index 00000000000..5f64058a5da --- /dev/null +++ b/debian/ceph-mon.prerm @@ -0,0 +1,23 @@ +#!/bin/sh +# vim: set noet ts=8: + +set -e + +case "$1" in + remove) + [ -x /sbin/stop ] && stop ceph-mon-all || true + invoke-rc.d ceph stop mon || { + RESULT=$? + if [ $RESULT != 100 ]; then + exit $RESULT + fi + } + ;; + + *) + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/ceph-osd.postinst b/debian/ceph-osd.postinst new file mode 100644 index 00000000000..b642dfe3464 --- /dev/null +++ b/debian/ceph-osd.postinst @@ -0,0 +1,45 @@ +# vim: set noet ts=8: +# postinst script for ceph-osd +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# +# postinst configure +# old-postinst abort-upgrade +# conflictor's-postinst abort-remove in-favour +# postinst abort-remove +# deconfigured's-postinst abort-deconfigure in-favour [ ] +# + +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +[ -f "/etc/default/ceph" ] && . /etc/default/ceph +[ -z "$SERVER_USER" ] && SERVER_USER=ceph +[ -z "$SERVER_GROUP" ] && SERVER_GROUP=ceph + +case "$1" in + configure) + [ -x /sbin/start ] && start ceph-osd-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/ceph-osd.prerm b/debian/ceph-osd.prerm new file mode 100644 index 00000000000..40f07b62152 --- /dev/null +++ b/debian/ceph-osd.prerm @@ -0,0 +1,23 @@ +#!/bin/sh +# vim: set noet ts=8: + +set -e + +case "$1" in + remove) + [ -x /sbin/stop ] && stop ceph-osd-all || true + invoke-rc.d ceph stop osd || { + RESULT=$? + if [ $RESULT != 100 ]; then + exit $RESULT + fi + } + ;; + + *) + ;; +esac + +#DEBHELPER# + +exit 0