]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Use invoke-rc.d in maintainer scripts 304/head
authorJames Page <james.page@ubuntu.com>
Tue, 21 May 2013 08:20:53 +0000 (09:20 +0100)
committerJames Page <james.page@ubuntu.com>
Tue, 21 May 2013 08:22:39 +0000 (09:22 +0100)
Upstart configurations and sysv init scripts should be started and stopped
using invoke-rc.d in maintainer scripts.

This ensures the correct behaviour across both Debian (sysv) and Ubuntu (upstart)
and in restricted environments such as schroot where start/stop of services from
maintainer scripts is normally disabled.

Signed-off-by: James Page <james.page@ubuntu.com>
debian/ceph-mds.postinst
debian/ceph-mds.prerm
debian/ceph.postinst
debian/ceph.prerm

index 7fcbf5c623046ea9b40266b28152eb990595dc9d..316aa7b1040c486a0831fec36d3a7bee3963f2cf 100644 (file)
@@ -1,4 +1,5 @@
 #!/bin/sh
+# vim: set noet ts=8:
 # postinst script for ceph-mds
 #
 # see: dh_installdeb(1)
@@ -20,7 +21,14 @@ set -e
 
 case "$1" in
     configure)
-       [ -x /sbin/start ] && start ceph-mds-all || :
+       invoke-rc.d ceph-mds-all start || {
+               RESULT=$?
+               # Ignore if ceph-mds-all upstart config does not
+               # exist or upstart is not in use
+               if [ $RESULT != 100 ]; then
+                       exit $RESULT
+               fi
+       }
     ;;
     abort-upgrade|abort-remove|abort-deconfigure)
        :
index c4af0994d948260ee4bea9df2a5aa49ec002dc52..e4cd62c985f9d157bd6a55075f0fc4620482a848 100644 (file)
@@ -1,5 +1,17 @@
 #!/bin/sh
+# vim: set noet ts=8:
 
-[ -x /sbin/stop ] && stop ceph-mds-all || :
+set -e
 
-exit 0
\ No newline at end of file
+invoke-rc.d ceph-mds-all stop || {
+       RESULT=$?
+       # Ignore if ceph-all upstart config does not
+       # exist or upstart is not in use
+       if [ $RESULT != 100 ]; then
+               exit $RESULT
+       fi
+}
+
+#DEBHELPER#
+
+exit 0
index 090a91aa9bb3bbe6810077b75ef9aa2e007f67c0..cf760d02c09ba15820acd5e2bb5fe744a76a9ff3 100644 (file)
@@ -1,4 +1,5 @@
 #!/bin/sh
+# vim: set noet ts=8:
 # postinst script for ceph
 #
 # see: dh_installdeb(1)
@@ -27,7 +28,14 @@ set -e
 case "$1" in
     configure)
        rm -f /etc/init/ceph.conf
-       [ -x /sbin/start ] && start ceph-all || :
+       invoke-rc.d ceph-all start || {
+               RESULT=$?
+               # Ignore if ceph-all upstart config does not
+               # exist or upstart is not in use
+               if [ $RESULT != 100 ]; then
+                       exit $RESULT
+               fi
+       }
     ;;
     abort-upgrade|abort-remove|abort-deconfigure)
        :
index 557a1dbdac052215933bcab702a50f39dc92b89e..17f8bcc309715eaa5d75c4659e092ebfe10c1724 100644 (file)
@@ -1,5 +1,17 @@
 #!/bin/sh
+# vim: set noet ts=8:
 
-[ -x /sbin/stop ] && stop ceph-all || :
+set -e
 
-exit 0
\ No newline at end of file
+invoke-rc.d ceph-all stop || {
+       RESULT=$?
+       # Ignore if ceph-all upstart config does not
+       # exist or upstart is not in use
+       if [ $RESULT != 100 ]; then
+               exit $RESULT
+       fi
+}
+
+#DEBHELPER#
+
+exit 0