]> git.pld-linux.org Git - packages/ceph.git/blame - cephctl
systemd files added from the upstream repo
[packages/ceph.git] / cephctl
CommitLineData
b6163d67
JK
1#! /bin/bash
2
3### BEGIN INIT INFO
4# Provides: ceph ceph-mon ceph-osd
5# Required-Start: $network $remote_fs
6# Required-Stop: $network $remote_fs
7# Should-Start: network-remotefs
8# Should-Stop: network-remotefs
9# Default-Start: 3 5
10# Default-Stop: 0 1 2 6
11# Short-Description: Ceph is a distributed object, and block, storage platform
12# Description: Ceph is a distributed object, block, and file storage platform
13### END INIT INFO
14
15SYSTEMD_NO_WRAP=1 . /etc/rc.status
16rc_reset
17
18action=$1 ; shift
19cluster="ceph"
20config=$1 ; shift
21
22# Shared variables by many actions
23dir_mon="/var/lib/ceph/mon/"
24dir_osd="/var/lib/ceph/osd/"
25if test -d ${dir_mon} ; then
26lmon=`ls ${dir_mon} | grep ${cluster}`
27fi
28if test -d ${dir_osd} ; then
29losd=`ls ${dir_osd} | grep ${cluster}`
30fi
31prefix="${cluster}-"
32
33if test -n "$config" ; then
34 systemctl "${action}" "ceph-mon@${config}.service"
35else
36 case $action in
37 start | stop | status | enable | disable | restart | is-active | is-failed | show | kill | reset-failed )
38 n=0
39 if test -n ${lmon} ; then
40 for s in ${lmon#=${prefix}} ; do
41 systemctl "${action}" ceph-mon@${s#$prefix}.service
42 rc_check
43 ((++n))
44 done
45 fi
46 if test -n ${lmon} ; then
47 for s in ${losd#=${prefix}} ; do
48 systemctl "${action}" ceph-osd@${s#$prefix}.service
49 rc_check
50 ((++n))
51 done
52 fi
53 if test $n -gt 0 ; then
54 rc_status
55 else
56 rc_status -u
57 fi
58 ;;
59 *)
60 echo "Invalid paramter : $action"
61 echo "Valid paramters : start | stop | status | enable | disable | restart | is-active | is-failed | show | kill | reset-failed"
62 ;;
63 esac
64fi
65rc_exit
66
This page took 0.037595 seconds and 4 git commands to generate.