summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-05-22 09:47:29 -0700
committerSage Weil <sage@inktank.com>2013-05-22 13:26:04 -0700
commit6e5f0db75a2bf591bd1fc0a5c2a93051f83ebc5d (patch)
tree1d87273236b7d3e439e3818c8fd6206e61c4f9c8
parent674e75bc0783cd9befe9c20e36fbc2cfdac62e5a (diff)
downloadceph-6e5f0db75a2bf591bd1fc0a5c2a93051f83ebc5d.tar.gz
sysvinit: fix osd weight calculation on remote hosts
We need to do df on the remote host, not locally. Simlarly, the ceph command uses the osd key, which exists remotely; run it there. Signed-off-by: Sage Weil <sage@inktank.com> (cherry picked from commit d81d0ea5c442699570bd93a90bea0d97a288a1e9)
-rw-r--r--src/init-ceph.in17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/init-ceph.in b/src/init-ceph.in
index e2fb78592e9..c922eb3078b 100644
--- a/src/init-ceph.in
+++ b/src/init-ceph.in
@@ -310,19 +310,20 @@ 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" \
- --keyring="$osd_keyring" \
+ do_cmd "$BINDIR/ceph \
+ --name=osd.$id \
+ --keyring=$osd_keyring \
osd crush create-or-move \
-- \
- "$id" \
- "${osd_weight:-${defaultweight:-1}}" \
+ $id \
+ ${osd_weight:-${defaultweight:-1}} \
root=default \
- host="$host" \
+ host=$host \
$osd_location \
- || :
+ || :"
fi
fi