From b4a769df32ef98650c4c168eb4a9a139a6951ebb Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 16 Nov 2012 16:37:14 -0800 Subject: [PATCH] upstart: add ceph-osd-all-starter.conf 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 --- src/Makefile.am | 1 + src/upstart/ceph-osd-all-starter.conf | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 src/upstart/ceph-osd-all-starter.conf diff --git a/src/Makefile.am b/src/Makefile.am index cfb1140783e76..0c85b8e3d3447 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 index 0000000000000..c4d74e58442e7 --- /dev/null +++ b/src/upstart/ceph-osd-all-starter.conf @@ -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 -- 2.39.5