ceph/src/stop.sh

52 lines
811 B
Bash
Raw Normal View History

#!/bin/sh
test -d dev/osd0/. && test -e dev/sudo && SUDO="sudo"
do_killall() {
pg=`pgrep -f crun.*$1`
2010-07-07 14:47:57 +00:00
[ -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 | cmon )
stop_mon=1
stop_all=0
;;
mds | cmds )
stop_mds=1
stop_all=0
;;
osd | cosd )
stop_osd=1
stop_all=0
;;
* )
printf "$usage"
exit
esac
shift
done
if [ $stop_all -eq 1 ]; then
killall cmon cmds cosd
2009-01-08 22:43:04 +00:00
pkill -f valgrind.bin.\*cmon
$SUDO pkill -f valgrind.bin.\*cosd
2009-01-08 22:43:04 +00:00
pkill -f valgrind.bin.\*cmds
else
[ $stop_mon -eq 1 ] && do_killall cmon
[ $stop_mds -eq 1 ] && do_killall cmds
[ $stop_osd -eq 1 ] && do_killall cosd
fi