From: Sage Weil Date: Tue, 12 Jun 2012 20:39:57 +0000 (-0700) Subject: radosgw: upstart support X-Git-Tag: v0.48argonaut~59^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=282277dece0bac88e086bc994bbb60f690f4b0dc;p=ceph.git radosgw: upstart support 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 --- diff --git a/src/Makefile.am b/src/Makefile.am index c02f4c31748..17333b703f1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 index 00000000000..ef7d23a8316 --- /dev/null +++ b/src/upstart/radosgw-all-starter.conf @@ -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 index 00000000000..b5966d3d3dd --- /dev/null +++ b/src/upstart/radosgw-all.conf @@ -0,0 +1 @@ +description "Ceph radosgw (all instances)" diff --git a/src/upstart/radosgw.conf b/src/upstart/radosgw.conf new file mode 100644 index 00000000000..3446cf297d5 --- /dev/null +++ b/src/upstart/radosgw.conf @@ -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