]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
modified: src/init-ceph.in 307/head
authorXiaoxi Chen <xiaoxi.chen@intel.com>
Thu, 23 May 2013 01:33:27 +0000 (09:33 +0800)
committerXiaoxi Chen <xiaoxi.chen@intel.com>
Thu, 23 May 2013 01:33:27 +0000 (09:33 +0800)
fixed bug in init script, the "df" should be run on remote host by do_cmd,
and use $host instead of "hostname -s"

Signed-off-by: Xiaoxi Chen <xiaoxi.chen@intel.com>
src/init-ceph.in

index e8a71949995ed34adc8df5c522a9850532dcbff4..5914cd2294c63e12b4269310d515a63753168375 100644 (file)
@@ -310,7 +310,7 @@ for name in $what; do
                     # command line, ceph.conf can override what it wants
                    get_conf osd_location "" "osd crush location"
                    get_conf osd_weight "" "osd crush initial weight"
-                   defaultweight=`df $osd_data/. | tail -1 | awk '{ d= $2/1073741824 ; r = sprintf("%.2f", d); print r }'`
+                   defaultweight="$(do_cmd "df $osd_data/. | tail -1 | awk '{ d= \$2/1073741824 ; r = sprintf(\"%.2f\", d); print r }'")"
                    get_conf osd_keyring "$osd_data/keyring" "keyring"
                    $BINDIR/ceph \
                        --name="osd.$id" \
@@ -320,7 +320,7 @@ for name in $what; do
                        "$id" \
                        "${osd_weight:-${defaultweight:-1}}" \
                        root=default \
-                       host="$(hostname -s)" \
+                       host=$host \
                        $osd_location \
                        || :
                fi