mirror of
https://github.com/ceph/ceph
synced 2024-12-28 22:43:29 +00:00
Merge pull request #26680 from yuvalif/add_kill_9_to_mstop
mstop.sh allow kill -9 after failing to kill procs Reviewed-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
commit
ab1b1a9fb9
@ -27,6 +27,8 @@ else
|
||||
pfiles=`ls $pidpath/$entity.$id.pid` || true
|
||||
fi
|
||||
|
||||
MAX_RETRIES=20
|
||||
|
||||
for pidfile in $pfiles; do
|
||||
pid=`cat $pidfile`
|
||||
fname=`echo $pidfile | sed 's/.*\///g'`
|
||||
@ -38,11 +40,17 @@ for pidfile in $pfiles; do
|
||||
name=`echo $fname | sed 's/\.pid$//g'`
|
||||
[ "$entity" == "radosgw" ] && extra_check="-e lt-radosgw"
|
||||
echo entity=$entity pid=$pid name=$name
|
||||
counter=0
|
||||
signal=""
|
||||
while ps -p $pid -o args= | grep -q -e $entity $extracheck ; do
|
||||
if [[ "$counter" -gt MAX_RETRIES ]]; then
|
||||
signal="-9"
|
||||
fi
|
||||
cmd="kill $signal $pid"
|
||||
printf "$cmd...\n"
|
||||
$cmd
|
||||
sleep 1
|
||||
counter=$((counter+1))
|
||||
continue
|
||||
done
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user