install -d -m0755 /var/run/ceph
- # 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" --name="osd.$id" --lookup osd_crush_initial_weight || :)"
- ceph \
- --cluster="${cluster:-ceph}" \
- --name="osd.$id" \
- --keyring="/var/lib/ceph/osd/${cluster:-ceph}-$id/keyring" \
- osd crush create-or-move \
- -- \
- "$id" \
- "${weight:-1}" \
- root=default \
- host="$(hostname -s)" \
- $location \
- || :
+ 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; 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 || :)"
+ ceph \
+ --cluster="${cluster:-ceph}" \
+ --name="osd.$id" \
+ --keyring="/var/lib/ceph/osd/${cluster:-ceph}-$id/keyring" \
+ osd crush create-or-move \
+ -- \
+ "$id" \
+ "${weight:-1}" \
+ root=default \
+ host="$(hostname -s)" \
+ $location \
+ || :
+ fi
journal="/var/lib/ceph/osd/${cluster:-ceph}-$id/journal"
if [ -L "$journal" -a ! -e "$journal" ]; then
- echo "ceph-osd($UPSTART_INSTANCE): journal not present, not starting yet." 1>&2
- stop
- exit 0
+ echo "ceph-osd($UPSTART_INSTANCE): journal not present, not starting yet." 1>&2
+ stop
+ exit 0
fi
end script