]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
upstart: fix ceph-crush-location default 803/head
authorSage Weil <sage@inktank.com>
Fri, 1 Nov 2013 23:45:01 +0000 (16:45 -0700)
committerSage Weil <sage@inktank.com>
Fri, 1 Nov 2013 23:45:01 +0000 (16:45 -0700)
Behave if it is not specified on ceph.conf.  (init-ceph also falls back
to the default.)

Fixes: #6698
Signed-off-by: Sage Weil <sage@inktank.com>
src/upstart/ceph-osd.conf

index a2f659460da78c72f9161775e7814198e8e173ec..91ac22c5188c2bf6a950c0b76778ff7f75f7f517 100644 (file)
@@ -19,6 +19,9 @@ pre-start script
     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 || :)"
+       if [ -z "$hook" ]; then
+           hook="/usr/bin/ceph-crush-location"
+       fi
        location="$($hook --cluster ${cluster:-ceph} --id $id --type osd)"
        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 }'`