From: Sage Weil Date: Tue, 29 Oct 2013 20:58:10 +0000 (-0700) Subject: Revert "upstart, sysvinit: use ceph-crush-location hook" X-Git-Tag: v0.72-rc1~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=22ff717688986a6cf3f56c98c8b58c9ab15696fd;p=ceph.git Revert "upstart, sysvinit: use ceph-crush-location hook" This reverts commit 111a37efb19cb46a48d669bc9866c29b4015a889. --- diff --git a/src/init-ceph.in b/src/init-ceph.in index 7399abb8f8585..1a80a42b03ec9 100644 --- a/src/init-ceph.in +++ b/src/init-ceph.in @@ -318,9 +318,9 @@ for name in $what; do if [ "$type" = "osd" ]; then get_conf update_crush "" "osd crush update on start" if [ "${update_crush:-1}" = "1" -o "{$update_crush:-1}" = "true" ]; then - # update location in crush - get_conf osd_location_hook "$BINDIR/ceph-crush-location" "osd crush location hook" - osd_location=`$osd_location_hook --cluster ceph --id $id --type osd` + # update location in crush; put in some suitable defaults on the + # 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="$(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" @@ -331,6 +331,8 @@ for name in $what; do -- \ $id \ ${osd_weight:-${defaultweight:-1}} \ + root=default \ + host=$host \ $osd_location" fi fi diff --git a/src/upstart/ceph-osd.conf b/src/upstart/ceph-osd.conf index a2f659460da78..ab6af5835e0dd 100644 --- a/src/upstart/ceph-osd.conf +++ b/src/upstart/ceph-osd.conf @@ -17,9 +17,9 @@ pre-start script update="$(ceph-conf --cluster=${cluster:-ceph} --name=osd.$id --lookup osd_crush_update_on_start || :)" if [ "${update:-1}" = "1" -o "{$update:-1}" = "true" ]; then - # update location in crush - hook="$(ceph-conf --cluster=${cluster:-ceph} --name=osd.$id --lookup osd_crush_location_hook || :)" - location="$($hook --cluster ${cluster:-ceph} --id $id --type osd)" + # update location in crush; put in some suitable defaults on the + # command line, ceph.conf can override what it wants + location="$(ceph-conf --cluster=${cluster:-ceph} --name=osd.$id --lookup osd_crush_location || :)" weight="$(ceph-conf --cluster=${cluster:-ceph} --name=osd.$id --lookup osd_crush_initial_weight || :)" defaultweight=`df /var/lib/ceph/osd/${cluster:-ceph}-$id/ | tail -1 | awk '{ d= $2/1073741824 ; r = sprintf("%.2f", d); print r }'` ceph \ @@ -30,6 +30,8 @@ pre-start script -- \ "$id" \ "${weight:-${defaultweight:-1}}" \ + root=default \ + host="$(hostname -s)" \ $location fi