2012-11-17 00:37:14 +00:00
|
|
|
description "Ceph OSD (start all instances)"
|
|
|
|
|
|
|
|
start on starting ceph-osd-all
|
|
|
|
|
|
|
|
task
|
|
|
|
|
|
|
|
script
|
|
|
|
set -e
|
2013-06-14 20:39:03 +00:00
|
|
|
|
|
|
|
# first activate any partitions
|
|
|
|
ceph-disk activate-all
|
|
|
|
|
2012-11-17 00:37:14 +00:00
|
|
|
# TODO what's the valid charset for cluster names and osd ids?
|
2013-07-02 21:43:17 +00:00
|
|
|
find -L /var/lib/ceph/osd/ -mindepth 1 -maxdepth 1 -regextype posix-egrep -regex '.*/[A-Za-z0-9]+-[A-Za-z0-9._-]+' -printf '%P\n' \
|
2012-11-17 00:37:14 +00:00
|
|
|
| while read f; do
|
2013-11-25 21:43:43 +00:00
|
|
|
if [ -e "/var/lib/ceph/osd/$f/ready" ] && [ -e "/var/lib/ceph/osd/$f/upstart" ] && [ ! -e "/var/lib/ceph/osd/$f/sysvinit" ]; then
|
2012-11-17 00:37:14 +00:00
|
|
|
cluster="${f%%-*}"
|
|
|
|
id="${f#*-}"
|
|
|
|
initctl emit ceph-osd cluster="$cluster" id="$id"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
end script
|