]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
upstart: add ceph-osd-all-starter.conf
authorSage Weil <sage@inktank.com>
Sat, 17 Nov 2012 00:37:14 +0000 (16:37 -0800)
committerSage Weil <sage@inktank.com>
Sat, 17 Nov 2012 01:28:14 +0000 (17:28 -0800)
Starter helper will start all osds that appear in /var/lib/ceph/osd/*,
as we do with the mons and mdss.

This will only proceed if the 'ready' file is there, which is currently
only touched by ceph-disk-activate.

Signed-off-by: Sage Weil <sage@inktank.com>
src/Makefile.am
src/upstart/ceph-osd-all-starter.conf [new file with mode: 0644]

index cfb1140783e76992c634cfb4e228b506889f1caa..0c85b8e3d344709d002ae9bb19c5406b9ac8ddae 100644 (file)
@@ -1074,6 +1074,7 @@ EXTRA_DIST += \
        $(srcdir)/upstart/ceph-create-keys.conf \
        $(srcdir)/upstart/ceph-osd.conf \
        $(srcdir)/upstart/ceph-osd-all.conf \
+       $(srcdir)/upstart/ceph-osd-all-starter.conf \
        $(srcdir)/upstart/ceph-hotplug.conf \
        $(srcdir)/upstart/ceph-mds.conf \
        $(srcdir)/upstart/ceph-mds-all.conf \
diff --git a/src/upstart/ceph-osd-all-starter.conf b/src/upstart/ceph-osd-all-starter.conf
new file mode 100644 (file)
index 0000000..c4d74e5
--- /dev/null
@@ -0,0 +1,20 @@
+description "Ceph OSD (start all instances)"
+
+start on starting ceph-osd-all
+stop on runlevel [!2345] or stopping ceph-osd-all
+
+task
+
+script
+  set -e
+  # TODO what's the valid charset for cluster names and osd ids?
+  find /var/lib/ceph/osd/ -mindepth 1 -maxdepth 1 -regextype posix-egrep -regex '.*/[a-z0-9]+-[a-z0-9._-]+' -printf '%P\n' \
+  | while read f; do
+    if [ -e "/var/lib/ceph/osd/$f/ready" ]; then
+        cluster="${f%%-*}"
+        id="${f#*-}"
+
+       initctl emit ceph-osd cluster="$cluster" id="$id"
+    fi
+  done
+end script