From: Sage Weil Date: Tue, 30 Apr 2013 00:01:55 +0000 (-0700) Subject: debian: only start/stop upstart jobs if upstart is present X-Git-Tag: v0.56.5~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d0678a062a1baf738ce96114114d99495be19478;p=ceph.git debian: only start/stop upstart jobs if upstart is present This avoids errors on non-upstart distros (like wheezy). Signed-off-by: Sage Weil (cherry picked from commit 030bf8aaa15837f898e453161eeaf1d52fc5779d) Conflicts: debian/ceph-mds.postinst --- diff --git a/debian/ceph-mds.postinst b/debian/ceph-mds.postinst new file mode 100644 index 00000000000..7fcbf5c6230 --- /dev/null +++ b/debian/ceph-mds.postinst @@ -0,0 +1,42 @@ +#!/bin/sh +# postinst script for ceph-mds +# +# 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 + + +case "$1" in + configure) + [ -x /sbin/start ] && start ceph-mds-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-mds.prerm b/debian/ceph-mds.prerm index 56d9e0128f1..c4af0994d94 100644 --- a/debian/ceph-mds.prerm +++ b/debian/ceph-mds.prerm @@ -1,5 +1,5 @@ #!/bin/sh -stop ceph-mds-all || : +[ -x /sbin/stop ] && stop ceph-mds-all || : exit 0 \ No newline at end of file diff --git a/debian/ceph.postinst b/debian/ceph.postinst index 4edbf10d93b..090a91aa9bb 100644 --- a/debian/ceph.postinst +++ b/debian/ceph.postinst @@ -27,7 +27,7 @@ set -e case "$1" in configure) rm -f /etc/init/ceph.conf - start ceph-all || : + [ -x /sbin/start ] && start ceph-all || : ;; abort-upgrade|abort-remove|abort-deconfigure) : diff --git a/debian/ceph.prerm b/debian/ceph.prerm index 159a96e33c3..557a1dbdac0 100644 --- a/debian/ceph.prerm +++ b/debian/ceph.prerm @@ -1,5 +1,5 @@ #!/bin/sh -stop ceph-all || : +[ -x /sbin/stop ] && stop ceph-all || : exit 0 \ No newline at end of file