Till Westmann | 276bbc2 | 2013-06-05 18:56:27 -0700 | [diff] [blame] | 1 | #/* |
| 2 | # Copyright 2009-2013 by The Regents of the University of California |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # you may obtain a copy of the License from |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | #*/ |
vinayakb | 5d8a2f2 | 2013-01-29 19:45:44 +0000 | [diff] [blame] | 15 | hostname |
| 16 | . conf/cluster.properties |
| 17 | |
| 18 | #Kill process |
| 19 | PID=`ps -ef|grep ${USER}|grep java|grep 'Dapp.name=hyracksnc'|awk '{print $2}'` |
| 20 | |
| 21 | if [ "$PID" == "" ]; then |
buyingyi | 26198a2 | 2013-03-22 06:40:46 +0000 | [diff] [blame] | 22 | PID=`ps -ef|grep ${USER}|grep java|grep 'hyracks'|awk '{print $2}'` |
| 23 | fi |
| 24 | |
| 25 | if [ "$PID" == "" ]; then |
vinayakb | 5d8a2f2 | 2013-01-29 19:45:44 +0000 | [diff] [blame] | 26 | USERID=`id | sed 's/^uid=//;s/(.*$//'` |
| 27 | PID=`ps -ef|grep ${USERID}|grep java|grep 'Dapp.name=hyracksnc'|awk '{print $2}'` |
| 28 | fi |
| 29 | |
| 30 | echo $PID |
| 31 | kill -9 $PID |
| 32 | |
| 33 | #Clean up I/O working dir |
| 34 | io_dirs=$(echo $IO_DIRS | tr "," "\n") |
| 35 | for io_dir in $io_dirs |
| 36 | do |
| 37 | rm -rf $io_dir/* |
| 38 | done |
| 39 | |
| 40 | #Clean up NC temp dir |
| 41 | rm -rf $NCTMP_DIR/* |