diff options
author | Zhan Zhang <zhazhan@gmail.com> | 2015-02-19 23:13:02 +0000 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2015-02-19 23:14:56 +0000 |
commit | 18fbed5b54818a84671b726ae952736f3251f9ff (patch) | |
tree | 143d9bfd82de2f433192eac4375b0c63894c3e6e | |
parent | 856fdcb654184f4d4ea3d620e48093ce3ada4cbb (diff) | |
download | spark-18fbed5b54818a84671b726ae952736f3251f9ff.tar.gz spark-18fbed5b54818a84671b726ae952736f3251f9ff.tar.bz2 spark-18fbed5b54818a84671b726ae952736f3251f9ff.zip |
[Spark-5889] Remove pid file after stopping service.
Currently the pid file is not deleted, and potentially may cause some problem after service is stopped. The fix remove the pid file after service stopped.
Author: Zhan Zhang <zhazhan@gmail.com>
Closes #4676 from zhzhan/spark-5889 and squashes the following commits:
eb01be1 [Zhan Zhang] solve review comments
b4c009e [Zhan Zhang] solve review comments
018110a [Zhan Zhang] spark-5889: remove pid file after stopping service
088d2a2 [Zhan Zhang] squash all commits
c1f1fa5 [Zhan Zhang] test
(cherry picked from commit ad6b169dee84df175b51933b7a3ad7f0bbc52cf3)
Signed-off-by: Sean Owen <sowen@cloudera.com>
-rwxr-xr-x | sbin/spark-daemon.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/spark-daemon.sh b/sbin/spark-daemon.sh index e1bcc7d642..5e812a1d91 100755 --- a/sbin/spark-daemon.sh +++ b/sbin/spark-daemon.sh @@ -168,7 +168,7 @@ case $option in TARGET_ID="$(cat "$pid")" if [[ $(ps -p "$TARGET_ID" -o comm=) =~ "java" ]]; then echo "stopping $command" - kill "$TARGET_ID" + kill "$TARGET_ID" && rm -f "$pid" else echo "no $command to stop" fi |