]> git.pld-linux.org Git - packages/ceph.git/blame - cephctl
systemd: reload action added
[packages/ceph.git] / cephctl
CommitLineData
b6163d67
JK
1#! /bin/bash
2
8b205fd7
JK
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
b6163d67
JK
5
6action=$1 ; shift
8b205fd7
JK
7[ -f /etc/sysconfig/ceph ] && . /etc/sysconfig/ceph
8cluster=${CLUSTER:-ceph}
b6163d67
JK
9config=$1 ; shift
10
11# Shared variables by many actions
12dir_mon="/var/lib/ceph/mon/"
13dir_osd="/var/lib/ceph/osd/"
14if test -d ${dir_mon} ; then
15lmon=`ls ${dir_mon} | grep ${cluster}`
16fi
17if test -d ${dir_osd} ; then
18losd=`ls ${dir_osd} | grep ${cluster}`
19fi
20prefix="${cluster}-"
21
8b205fd7
JK
22RC=0
23
b6163d67 24if test -n "$config" ; then
8b205fd7 25 systemctl "${action}" "ceph-mon@${config}.service" || RC=1
b6163d67
JK
26else
27 case $action in
0bb0fd1a 28 start | stop | status | enable | disable | restart | is-active | is-failed | show | kill | reset-failed | reload )
b6163d67
JK
29 n=0
30 if test -n ${lmon} ; then
31 for s in ${lmon#=${prefix}} ; do
32 systemctl "${action}" ceph-mon@${s#$prefix}.service
8b205fd7 33 [ $? -eq 0 ] || RC=1
b6163d67
JK
34 ((++n))
35 done
36 fi
37 if test -n ${lmon} ; then
38 for s in ${losd#=${prefix}} ; do
39 systemctl "${action}" ceph-osd@${s#$prefix}.service
8b205fd7 40 [ $? -eq 0 ] || RC=1
b6163d67
JK
41 ((++n))
42 done
43 fi
b6163d67
JK
44 ;;
45 *)
46 echo "Invalid paramter : $action"
0bb0fd1a 47 echo "Valid paramters : start | stop | status | enable | disable | restart | is-active | is-failed | show | kill | reset-failed | reload"
b6163d67
JK
48 ;;
49 esac
50fi
8b205fd7 51exit $RC
This page took 0.07667 seconds and 4 git commands to generate.