-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstop.sh
executable file
·51 lines (45 loc) · 863 Bytes
/
stop.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
test -d dev/osd0/. && test -e dev/sudo && SUDO="sudo"
do_killall() {
pg=`pgrep -f ceph-run.*$1`
[ -n "$pg" ] && kill $pg
$SUDO killall $1
}
usage="usage: $0 [all] [mon] [mds] [osd]\n"
stop_all=1
stop_mon=0
stop_mds=0
stop_osd=0
while [ $# -ge 1 ]; do
case $1 in
all )
stop_all=1
;;
mon | ceph-mon )
stop_mon=1
stop_all=0
;;
mds | ceph-mds )
stop_mds=1
stop_all=0
;;
osd | ceph-osd )
stop_osd=1
stop_all=0
;;
* )
printf "$usage"
exit
esac
shift
done
if [ $stop_all -eq 1 ]; then
killall ceph-mon ceph-mds ceph-osd
pkill -f valgrind.bin.\*ceph-mon
$SUDO pkill -f valgrind.bin.\*ceph-osd
pkill -f valgrind.bin.\*ceph-mds
else
[ $stop_mon -eq 1 ] && do_killall ceph-mon
[ $stop_mds -eq 1 ] && do_killall ceph-mds
[ $stop_osd -eq 1 ] && do_killall ceph-osd
fi