diff options
author | James Page <james.page@ubuntu.com> | 2013-05-21 10:20:53 +0200 |
---|---|---|
committer | James Page <james.page@ubuntu.com> | 2013-05-21 10:22:39 +0200 |
commit | 19c5ac37ef87aeb3d3c30aa35cd61b6f3a8414bf (patch) | |
tree | fc22e6a8dbb8493c77f0370dc5f011fd2277b83d /debian/ceph-mds.postinst | |
parent | PG: kill some dead IndexedLog methods (diff) | |
download | ceph-19c5ac37ef87aeb3d3c30aa35cd61b6f3a8414bf.tar.xz ceph-19c5ac37ef87aeb3d3c30aa35cd61b6f3a8414bf.zip |
Use invoke-rc.d in maintainer scripts
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>
Diffstat (limited to 'debian/ceph-mds.postinst')
-rw-r--r-- | debian/ceph-mds.postinst | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/debian/ceph-mds.postinst b/debian/ceph-mds.postinst index 7fcbf5c6230..316aa7b1040 100644 --- a/debian/ceph-mds.postinst +++ b/debian/ceph-mds.postinst @@ -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) : |