Created
April 28, 2011 01:03
Revisions
-
dvryaboy created this gist
Apr 28, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ #!/bin/bash # Kill tasks holding on to deleted userlogs. These are most likely abandoned jobs. function get_bad_pids { for i in `ps -ef | grep java | awk '{print $2;}'`; do cnt=`/usr/sbin/lsof -p $i | grep deleted | grep /var/log/hadoop-0.20/userlogs/attempt | wc -l`; if [ $cnt -gt 0 ]; then PIDS=$i:$PIDS; fi done } PIDS="" get_bad_pids IFS=':' for pid in $PIDS; do kill -9 $pid; done