Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
CHUKWA-677. Added pid file check before starting processes. (Sreepath…
Browse files Browse the repository at this point in the history
…i Prasanna via Eric Yang)

git-svn-id: https://svn.apache.org/repos/asf/incubator/chukwa/trunk@1424080 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
macroadster committed Dec 19, 2012
1 parent dac18b1 commit e6ef506
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Expand Up @@ -30,6 +30,8 @@ Trunk (unreleased changes)

BUGS

CHUKWA-677. Added pid file check before starting processes. (Sreepathi Prasanna via Eric Yang)

CHUKWA-676. Exclude temporarily data from release audit tools. (Eric Yang)

CHUKWA-672. Fix adaptor not found in checkpoint after shutdown. (shreyas subramanya via asrabkin)
Expand Down
10 changes: 8 additions & 2 deletions bin/chukwa
Expand Up @@ -160,12 +160,18 @@ elif [ "$COMMAND" = "tail" ]; then
exit 0
fi

pid="${CHUKWA_PID_DIR}/$PID.pid"
if [ "$1" = "stop" ]; then
if [ -e ${CHUKWA_PID_DIR}/$PID.pid ]; then
kill -TERM `cat ${CHUKWA_PID_DIR}/$PID.pid`
if [ -e $pid ]; then
kill -TERM `cat $pid`
else
echo "Cannot find PID file - $PID.pid; NO $PID to stop";
fi
elif [ -f $pid ]; then
if kill -0 `cat $pid` > /dev/null 2>&1; then
echo $command running as process `cat $pid`. Stop it first.
exit 1
fi
else
# run command
if [ "$BACKGROUND" = "false" ]; then
Expand Down

0 comments on commit e6ef506

Please sign in to comment.