From 13925c706d5e9ba06d0dda2c337a605318ad91f4 Mon Sep 17 00:00:00 2001 From: Anthony Alba Date: Mon, 30 Nov 2015 16:44:31 +0800 Subject: [PATCH] init-ceph.in: Allow custom cluster names during startup. Signed-off-by: Richard Chan --- src/init-ceph.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/init-ceph.in b/src/init-ceph.in index a8f7a99f132d9..8c78f5f7a4996 100755 --- a/src/init-ceph.in +++ b/src/init-ceph.in @@ -142,6 +142,10 @@ dofsumount=0 verbose=0 use_default_conf=1 +## set variables like cluster or conf +[ -e /etc/sysconfig/ceph ] && . /etc/sysconfig/ceph +[ -e /etc/default/ceph ] && . /etc/default/ceph + while echo $1 | grep -q '^-'; do # FIXME: why not '^-'? case $1 in @@ -313,7 +317,7 @@ for name in $what; do lockfile="" fi - get_conf asok "$run_dir/ceph-$type.$id.asok" "admin socket" + get_conf asok "$run_dir/$cluster-$type.$id.asok" "admin socket" case "$command" in start) @@ -430,8 +434,8 @@ for name in $what; do # these keys. it's also true for legacy installs # via mkcephfs, which is fine too; there is no harm # in creating these keys. - get_conf mon_data "/var/lib/ceph/mon/ceph-$id" "mon data" - if [ "$mon_data" = "/var/lib/ceph/mon/ceph-$id" -a "$asok" = "/var/run/ceph/ceph-mon.$id.asok" ]; then + get_conf mon_data "/var/lib/ceph/mon/$cluster-$id" "mon data" + if [ "$mon_data" = "/var/lib/ceph/mon/$cluster-$id" -a "$asok" = "/var/run/ceph/$cluster-mon.$id.asok" ]; then echo Starting ceph-create-keys on $host... cmd2="$SBINDIR/ceph-create-keys --cluster $cluster -i $id 2> /dev/null &" do_cmd "$cmd2" -- 2.39.5