File 0015-rcceph-wrapper-for-ceph-systemd.patch of Package ceph.627

From: Owen Synge <osynge@suse.com>
Date: Wed, 10 Sep 2014 10:13:36 +0200
Subject: [PATCH] rcceph: wrapper for ceph systemd

systemd is easy to use if you have a wrapper.
message showing available paramters to rcceph.
Also check for directories contianing mon/osd deamon settings.
Added suport for chkconfig using LSB Header

Signed off by osynge@suse.com

(cherry picked from commit b552baad2413ed01115fa408099604fc62610f52)
---
 systemd/ceph | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)
 create mode 100644 systemd/ceph

diff --git a/systemd/ceph b/systemd/ceph
new file mode 100644
index 0000000..e60dec6
--- /dev/null
+++ b/systemd/ceph
@@ -0,0 +1,66 @@
+#! /bin/bash
+
+### BEGIN INIT INFO
+# Provides:       ceph ceph-mon ceph-osd
+# Required-Start: $network $remote_fs
+# Required-Stop:  $network $remote_fs
+# Should-Start: network-remotefs
+# Should-Stop: network-remotefs
+# Default-Start:  3 5
+# Default-Stop:   0 1 2 6
+# Short-Description: Ceph is a distributed object, and block, storage platform
+# Description:    Ceph is a distributed object, block, and file storage platform
+### END INIT INFO
+
+SYSTEMD_NO_WRAP=1 . /etc/rc.status
+rc_reset
+
+action=$1 ; shift
+cluster="ceph"
+config=$1 ; shift
+
+# Shared variables by many actions
+dir_mon="/var/lib/ceph/mon/"
+dir_osd="/var/lib/ceph/osd/"
+if test -d ${dir_mon} ; then
+lmon=`ls ${dir_mon} | grep ${cluster}`
+fi
+if test -d ${dir_osd} ; then
+losd=`ls ${dir_osd} | grep ${cluster}`
+fi
+prefix="${cluster}-"
+
+if test -n "$config" ; then
+	systemctl "${action}" "ceph-mon@${config}.service"
+else
+	case $action in
+    start | stop | status | enable | disable | restart | is-active | is-failed | show | kill | reset-failed  )
+        n=0
+        if test -n ${lmon} ; then
+            for s in ${lmon#=${prefix}} ; do
+                systemctl "${action}" ceph-mon@${s#$prefix}.service
+                rc_check
+                ((++n))
+            done
+        fi
+        if test -n ${lmon} ; then
+            for s in ${losd#=${prefix}} ; do
+                systemctl "${action}" ceph-osd@${s#$prefix}.service
+                rc_check
+                ((++n))
+            done
+        fi
+        if test $n -gt 0 ; then
+			rc_status
+		else
+			rc_status -u
+		fi
+    ;;
+	*)
+		echo "Invalid paramter : $action"
+        echo "Valid paramters  : start | stop | status | enable | disable | restart | is-active | is-failed | show | kill | reset-failed"
+	;;
+	esac
+fi
+rc_exit
+
openSUSE Build Service is sponsored by