]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw: upstart support
authorSage Weil <sage@inktank.com>
Tue, 12 Jun 2012 20:39:57 +0000 (13:39 -0700)
committerSage Weil <sage@inktank.com>
Wed, 13 Jun 2012 16:22:19 +0000 (09:22 -0700)
Like the other upstart configs, these assume the default value for
'rgw data'.  Same pattern as ceph-mon and ceph-mds.

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

index c02f4c317489cbcc5242c1464a1579ceab94985a..17333b703f1abeb363228319a4594499d64e3bc9 100644 (file)
@@ -911,6 +911,9 @@ EXTRA_DIST += \
        $(srcdir)/upstart/ceph-mds.conf \
        $(srcdir)/upstart/ceph-mds-all.conf \
        $(srcdir)/upstart/ceph-mds-all-starter.conf \
+       $(srcdir)/upstart/radosgw.conf \
+       $(srcdir)/upstart/radosgw-all.conf \
+       $(srcdir)/upstart/radosgw-all-starter.conf \
        ceph-disk-prepare \
        ceph-disk-activate
 
diff --git a/src/upstart/radosgw-all-starter.conf b/src/upstart/radosgw-all-starter.conf
new file mode 100644 (file)
index 0000000..ef7d23a
--- /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 /var/lib/ceph/radosgw/ -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/radosgw/$f/done" ]; then
+        cluster="${f%%-*}"
+        id="${f#*-}"
+        initctl emit radosgw cluster="$cluster" id="$id"
+    fi
+  done
+end script
diff --git a/src/upstart/radosgw-all.conf b/src/upstart/radosgw-all.conf
new file mode 100644 (file)
index 0000000..b5966d3
--- /dev/null
@@ -0,0 +1 @@
+description "Ceph radosgw (all instances)"
diff --git a/src/upstart/radosgw.conf b/src/upstart/radosgw.conf
new file mode 100644 (file)
index 0000000..3446cf2
--- /dev/null
@@ -0,0 +1,22 @@
+description "Ceph radosgw"
+
+start on radosgw
+stop on runlevel [!2345] or stopping radosgw-all
+
+respawn
+respawn limit 5 30
+
+pre-start script
+    set -e
+    test -x /usr/bin/radosgw || { stop; exit 0; }
+    test -d "/var/lib/ceph/radosgw/${cluster:-ceph}-$id" || { stop; exit 0; }
+
+    install -d -m0755 /var/run/ceph
+end script
+
+instance ${cluster:-ceph}/$id
+
+# this breaks oneiric
+#usage "cluster = name of cluster (defaults to 'ceph'); id = mds instance id"
+
+exec /usr/bin/radosgw --cluster="${cluster:-ceph}" -i "$id" -f