summaryrefslogtreecommitdiffstats
path: root/src/ceph_common.sh
diff options
context:
space:
mode:
authorJosh Durgin <josh.durgin@inktank.com>2013-11-25 22:43:43 +0100
committerJosh Durgin <josh.durgin@inktank.com>2013-12-04 00:28:05 +0100
commit5e34beb61b3f5a1ed4afd8ee2fe976de40f95ace (patch)
tree24d01132295ae53aacd58c96d67d9a820775052b /src/ceph_common.sh
parentMerge pull request #877 from ceph/wip-6892 (diff)
downloadceph-5e34beb61b3f5a1ed4afd8ee2fe976de40f95ace.tar.xz
ceph-5e34beb61b3f5a1ed4afd8ee2fe976de40f95ace.zip
init, upstart: prevent daemons being started by both
There can be only one init system starting a daemon. If there is a host entry in ceph.conf for a daemon, sysvinit would try to start it even if the daemon's directory did not include a sysvinit file. This preserves backwards compatibility with older installs using sysvinit, but if an upstart file is present in the daemon's directory, upstart will try to start them, regardless of host entries in ceph.conf. If there's an upstart file in a daemon's directory and a host entry for that daemon in ceph.conf, both sysvinit and upstart would attempt to manage it. Fix this by only starting daemons if the marker file for the other init system is not present. This maintains backwards compatibility with older installs using neither sysvinit or upstart marker files, and does not break any valid configurations. The only configuration that would break is one with both sysvinit and upstart files present for the same daemon. Backport: emperor, dumpling Reported-by: Tim Spriggs <tims@uahirise.org> Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'src/ceph_common.sh')
-rw-r--r--src/ceph_common.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ceph_common.sh b/src/ceph_common.sh
index cedda4fb6c0..01781b75415 100644
--- a/src/ceph_common.sh
+++ b/src/ceph_common.sh
@@ -50,6 +50,10 @@ check_host() {
#echo host for $name is $host, i am $hostname
+ if [ -e "/var/lib/ceph/$type/ceph-$id/upstart" ]; then
+ return 1
+ fi
+
# sysvinit managed instance in standard location?
if [ -e "/var/lib/ceph/$type/ceph-$id/sysvinit" ]; then
host="$hostname"