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