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() {
|
|
|
|
pg=`pgrep -f crun.*$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
|
2008-12-12 22:51:40 +00:00
|
|
|
|
|
|
|
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
|
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
|
2009-03-02 21:36:01 +00:00
|
|
|
killall cmon cmds cosd
|
2009-01-08 22:43:04 +00:00
|
|
|
pkill -f valgrind.bin.\*cmon
|
2009-04-13 17:19:47 +00:00
|
|
|
$SUDO pkill -f valgrind.bin.\*cosd
|
2009-01-08 22:43:04 +00:00
|
|
|
pkill -f valgrind.bin.\*cmds
|
2008-12-12 22:51:40 +00:00
|
|
|
else
|
|
|
|
[ $stop_mon -eq 1 ] && do_killall cmon
|
|
|
|
[ $stop_mds -eq 1 ] && do_killall cmds
|
|
|
|
[ $stop_osd -eq 1 ] && do_killall cosd
|
|
|
|
fi
|