4
stop on runlevel [!2345] or stopping ceph-osd-all
9
limit nofile 32768 32768
13
test -x /usr/bin/ceph-osd || { stop; exit 0; }
14
test -d "/var/lib/ceph/osd/${cluster:-ceph}-$id" || { stop; exit 0; }
16
install -d -m0755 /var/run/ceph
18
update="$(ceph-conf --cluster=${cluster:-ceph} --name=osd.$id --lookup osd_crush_update_on_start || :)"
19
if [ "${update:-1}" = "1" -o "${update:-1}" = "true" ]; then
20
# update location in crush
21
hook="$(ceph-conf --cluster=${cluster:-ceph} --name=osd.$id --lookup osd_crush_location_hook || :)"
22
if [ -z "$hook" ]; then
23
hook="/usr/bin/ceph-crush-location"
25
location="$($hook --cluster ${cluster:-ceph} --id $id --type osd)"
26
weight="$(ceph-conf --cluster=${cluster:-ceph} --name=osd.$id --lookup osd_crush_initial_weight || :)"
27
defaultweight=`df -P -k /var/lib/ceph/osd/${cluster:-ceph}-$id/ | tail -1 | awk '{ d= $2/1073741824 ; r = sprintf("%.2f", d); print r }'`
29
--cluster="${cluster:-ceph}" \
31
--keyring="/var/lib/ceph/osd/${cluster:-ceph}-$id/keyring" \
32
osd crush create-or-move \
35
"${weight:-${defaultweight:-1}}" \
39
journal="/var/lib/ceph/osd/${cluster:-ceph}-$id/journal"
40
if [ -L "$journal" -a ! -e "$journal" ]; then
41
udevadm settle --timeout=5 || :
42
if [ -L "$journal" -a ! -e "$journal" ]; then
43
echo "ceph-osd($UPSTART_INSTANCE): journal not present, not starting yet." 1>&2
50
instance ${cluster:-ceph}/$id
54
exec /usr/bin/ceph-osd --cluster="${cluster:-ceph}" -i "$id" -f