2011-05-06 18:10:16 +00:00
|
|
|
#!/bin/sh
|
2008-12-12 22:51:40 +00:00
|
|
|
|
2009-04-13 17:19:47 +00:00
|
|
|
test -d dev/osd0/. && test -e dev/sudo && SUDO="sudo"
|
|
|
|
|
2008-12-12 22:51:40 +00:00
|
|
|
do_killall() {
|
2011-09-21 23:28:43 +00:00
|
|
|
pg=`pgrep -f ceph-run.*$1`
|
2010-07-07 14:47:57 +00:00
|
|
|
[ -n "$pg" ] && kill $pg
|
2009-04-13 17:19:47 +00:00
|
|
|
$SUDO killall $1
|
2008-12-12 22:51:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
usage="usage: $0 [all] [mon] [mds] [osd]\n"
|
|
|
|
|
2011-05-06 18:10:16 +00:00
|
|
|
stop_all=1
|
|
|
|
stop_mon=0
|
|
|
|
stop_mds=0
|
|
|
|
stop_osd=0
|
2012-09-01 21:39:28 +00:00
|
|
|
stop_rgw=0
|
2008-12-12 22:51:40 +00:00
|
|
|
|
|
|
|
while [ $# -ge 1 ]; do
|
|
|
|
case $1 in
|
|
|
|
all )
|
|
|
|
stop_all=1
|
|
|
|
;;
|
2011-09-21 23:28:43 +00:00
|
|
|
mon | ceph-mon )
|
2008-12-12 22:51:40 +00:00
|
|
|
stop_mon=1
|
|
|
|
stop_all=0
|
|
|
|
;;
|
2011-09-21 23:28:43 +00:00
|
|
|
mds | ceph-mds )
|
2008-12-12 22:51:40 +00:00
|
|
|
stop_mds=1
|
|
|
|
stop_all=0
|
|
|
|
;;
|
2011-09-21 23:28:43 +00:00
|
|
|
osd | ceph-osd )
|
2008-12-12 22:51:40 +00:00
|
|
|
stop_osd=1
|
|
|
|
stop_all=0
|
|
|
|
;;
|
|
|
|
* )
|
|
|
|
printf "$usage"
|
|
|
|
exit
|
2011-05-06 18:07:05 +00:00
|
|
|
esac
|
|
|
|
shift
|
2008-12-12 22:51:40 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
if [ $stop_all -eq 1 ]; then
|
2012-09-01 21:39:28 +00:00
|
|
|
killall ceph-mon ceph-mds ceph-osd radosgw lt-radosgw apache2
|
2011-09-21 23:28:43 +00:00
|
|
|
pkill -f valgrind.bin.\*ceph-mon
|
|
|
|
$SUDO pkill -f valgrind.bin.\*ceph-osd
|
|
|
|
pkill -f valgrind.bin.\*ceph-mds
|
2008-12-12 22:51:40 +00:00
|
|
|
else
|
2011-09-21 23:28:43 +00:00
|
|
|
[ $stop_mon -eq 1 ] && do_killall ceph-mon
|
|
|
|
[ $stop_mds -eq 1 ] && do_killall ceph-mds
|
|
|
|
[ $stop_osd -eq 1 ] && do_killall ceph-osd
|
2012-09-01 21:39:28 +00:00
|
|
|
[ $stop_rgw -eq 1 ] && do_killall radosgw lt-radosgw apache2
|
2008-12-12 22:51:40 +00:00
|
|
|
fi
|