exit 1;
fi
+data="/var/lib/ceph/osd/${cluster:-ceph}-$id"
+journal="$data/journal"
+
update="$(ceph-conf --cluster=${cluster:-ceph} --name=osd.$id --lookup osd_crush_update_on_start || :)"
if [ "${update:-1}" = "1" -o "${update:-1}" = "true" ]; then
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 -P -k /var/lib/ceph/osd/${cluster:-ceph}-$id/ | tail -1 | awk '{ d= $2/1073741824 ; r = sprintf("%.4f", d); print r }'`
+ defaultweight=`df -P -k $data/ | tail -1 | awk '{ d= $2/1073741824 ; r = sprintf("%.4f", d); print r }'`
ceph \
--cluster="${cluster:-ceph}" \
--name="osd.$id" \
- --keyring="/var/lib/ceph/osd/${cluster:-ceph}-$id/keyring" \
+ --keyring="$data/keyring" \
osd crush create-or-move \
-- \
"$id" \
$location
fi
-journal="/var/lib/ceph/osd/${cluster:-ceph}-$id/journal"
if [ -L "$journal" -a ! -e "$journal" ]; then
udevadm settle --timeout=5 || :
if [ -L "$journal" -a ! -e "$journal" ]; then
exit 0
fi
fi
+
+
+# ensure ownership is correct
+owner=`stat -c %U $data/.`
+if [ $owner -ne 'ceph' -a $owner -ne 'root' ]; then
+ echo "ceph-osd data dir $data is not owned by 'ceph' or 'root'"
+ echo "you must 'ceph-disk chown ...' or similar to fix ownership"
+ exit 1
+fi
+
+exit 0