initial code repo
[stor4nfv.git] / src / ceph / src / upstart / radosgw-all-starter.conf
diff --git a/src/ceph/src/upstart/radosgw-all-starter.conf b/src/ceph/src/upstart/radosgw-all-starter.conf
new file mode 100644 (file)
index 0000000..8ab3c0d
--- /dev/null
@@ -0,0 +1,18 @@
+description "Ceph radosgw (task to start all instances)"
+
+start on starting radosgw-all
+
+task
+
+script
+  set -e
+  # TODO what's the valid charset for cluster names and daemon ids?
+  find -L /var/lib/ceph/radosgw/ -mindepth 1 -maxdepth 1 -regextype posix-egrep -regex '.*/[A-Za-z0-9]+-[A-Za-z0-9._-]+' -printf '%P\n' \
+  | while read f; do
+    if [ -e "/var/lib/ceph/radosgw/$f/done" ]; then
+        cluster="${f%%-*}"
+        id="${f#*-}"
+        initctl emit radosgw cluster="$cluster" id="$id"
+    fi
+  done
+end script