Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions tajo-dist/src/main/bin/tajo-daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ fi
export TAJO_LOGFILE=tajo-$TAJO_IDENT_STRING-$command-$HOSTNAME.log
export TAJO_ROOT_LOGGER_APPENDER="${TAJO_ROOT_LOGGER_APPENDER:-DRFA}"
export TAJO_PULLSERVER_STANDALONE="${TAJO_PULLSERVER_STANDALONE:-false}"
export TAJO_STOP_TIMEOUT=${TAJO_STOP_TIMEOUT:-2}
log=$TAJO_LOG_DIR/tajo-$TAJO_IDENT_STRING-$command-$HOSTNAME.out
pid=$TAJO_PID_DIR/tajo-$TAJO_IDENT_STRING-$command.pid

Expand Down Expand Up @@ -132,12 +133,19 @@ case $startStop in
(stop)

if [ -f $pid ]; then
if kill -0 `cat $pid` > /dev/null 2>&1; then
TARGET_PID=`cat $pid`
if kill -0 $TARGET_PID > /dev/null 2>&1; then
echo stopping $command
kill `cat $pid`
kill $TARGET_PID
sleep $TAJO_STOP_TIMEOUT
if kill -0 $TARGET_PID > /dev/null 2>&1; then
echo "$command did not stop gracefully after $TAJO_STOP_TIMEOUT seconds: killing with kill -9"
kill -9 $TARGET_PID
fi
else
echo no $command to stop
fi
rm -f $pid
else
echo no $command to stop
fi
Expand Down