Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / upstart / ceph-osd-all-starter.conf
1 description "Ceph OSD (start all instances)"
2
3 start on starting ceph-osd-all
4
5 task
6
7 script
8   set -e
9
10   # first activate any partitions
11   ceph-disk activate-all
12
13   # TODO what's the valid charset for cluster names and osd ids?
14   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' \
15   | while read f; do
16     if [ -e "/var/lib/ceph/osd/$f/ready" ] && [ -e "/var/lib/ceph/osd/$f/upstart" ] && [ ! -e "/var/lib/ceph/osd/$f/sysvinit" ]; then
17         cluster="${f%%-*}"
18         id="${f#*-}"
19         initctl emit ceph-osd cluster="$cluster" id="$id"
20     fi
21   done
22 end script