Merge pull request #8617 from liewegas/wip-15098

debian: start ceph-mon-all and ceph-osd-all on package install …

Reviewed-by: Ken Dreyer <kdreyer@redhat.com>
Reviewed-by: Dan Mick <dmick@redhat.com>
Tested-by: Yuri Weinstein <yweinste@redhat.com>
This commit is contained in:
Sage Weil 2016-04-15 21:22:57 -04:00
commit 266cfe1879
4 changed files with 136 additions and 0 deletions

45
debian/ceph-mon.postinst vendored Normal file
View File

@ -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 <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
[ -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

23
debian/ceph-mon.prerm vendored Normal file
View File

@ -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

45
debian/ceph-osd.postinst vendored Normal file
View File

@ -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 <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
[ -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

23
debian/ceph-osd.prerm vendored Normal file
View File

@ -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