]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
init-ceph.in: Allow custom cluster names during startup. 6732/head
authorAnthony Alba <ascanio.alba7@gmail.com>
Mon, 30 Nov 2015 08:44:31 +0000 (16:44 +0800)
committerRichard Chan <richard@treeboxsolutions.com>
Tue, 1 Dec 2015 23:48:23 +0000 (07:48 +0800)
Signed-off-by: Richard Chan <richard@treeboxsolutions.com>
src/init-ceph.in

index a8f7a99f132d9ceef8c8178ba9a9e10b44efce1b..8c78f5f7a4996be39cb18cdcaed4b6ecf3c4fb56 100755 (executable)
@@ -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"