]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
debian: only start/stop upstart jobs if upstart is present
authorSage Weil <sage@inktank.com>
Tue, 30 Apr 2013 00:01:55 +0000 (17:01 -0700)
committerSage Weil <sage@inktank.com>
Thu, 2 May 2013 16:26:03 +0000 (09:26 -0700)
This avoids errors on non-upstart distros (like wheezy).

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 030bf8aaa15837f898e453161eeaf1d52fc5779d)

Conflicts:
debian/ceph-mds.postinst

debian/ceph-mds.postinst [new file with mode: 0644]
debian/ceph-mds.prerm
debian/ceph.postinst
debian/ceph.prerm

diff --git a/debian/ceph-mds.postinst b/debian/ceph-mds.postinst
new file mode 100644 (file)
index 0000000..7fcbf5c
--- /dev/null
@@ -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 <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
+
+
+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
+
+
index 56d9e0128f1049e0fab7242a40a8f76502120187..c4af0994d948260ee4bea9df2a5aa49ec002dc52 100644 (file)
@@ -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
index 4edbf10d93b6428be9ca9e605f1ca8bf14976cf8..090a91aa9bb3bbe6810077b75ef9aa2e007f67c0 100644 (file)
@@ -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)
        :
index 159a96e33c391fa0229603f5da7d0cdbb01a49c6..557a1dbdac052215933bcab702a50f39dc92b89e 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-stop ceph-all || :
+[ -x /sbin/stop ] && stop ceph-all || :
 
 exit 0
\ No newline at end of file