3 # It seems this was designed as /etc/init.d/ceph script for controlling the systemd
4 # units on SuSE, made into 'cephctl' for PLD
6 systemd_booted 2>/dev/null || exec /etc/rc.d/init.d/ceph "$@"
9 [ -f /etc/sysconfig/ceph ] && . /etc/sysconfig/ceph
10 cluster=${CLUSTER:-ceph}
13 # Shared variables by many actions
14 dir_mon="/var/lib/ceph/mon/"
15 dir_osd="/var/lib/ceph/osd/"
16 if test -d ${dir_mon} ; then
17 lmon=`ls ${dir_mon} | grep ${cluster}`
19 if test -d ${dir_osd} ; then
20 losd=`ls ${dir_osd} | grep ${cluster}`
26 if test -n "$config" ; then
27 systemctl "${action}" "ceph-mon@${config}.service" || RC=1
30 start | stop | status | enable | disable | restart | is-active | is-failed | show | kill | reset-failed | reload )
32 if test -n ${lmon} ; then
33 for s in ${lmon#=${prefix}} ; do
34 systemctl "${action}" ceph-mon@${s#$prefix}.service
39 if test -n ${lmon} ; then
40 for s in ${losd#=${prefix}} ; do
41 systemctl "${action}" ceph-osd@${s#$prefix}.service
48 echo "Invalid paramter : $action"
49 echo "Valid paramters : start | stop | status | enable | disable | restart | is-active | is-failed | show | kill | reset-failed | reload"