]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "upstart, sysvinit: use ceph-crush-location hook"
authorSage Weil <sage@inktank.com>
Tue, 29 Oct 2013 20:58:10 +0000 (13:58 -0700)
committerSage Weil <sage@inktank.com>
Tue, 29 Oct 2013 20:58:32 +0000 (13:58 -0700)
This reverts commit 111a37efb19cb46a48d669bc9866c29b4015a889.

src/init-ceph.in
src/upstart/ceph-osd.conf

index 7399abb8f85855f2248c4afb22bf94f2e2f080a2..1a80a42b03ec9a14df3669940998e1199002bace 100644 (file)
@@ -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
index a2f659460da78c72f9161775e7814198e8e173ec..ab6af5835e0ddbeb0ba76925e24ae1bc18e5ab52 100644 (file)
@@ -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