Repository: knox Updated Branches: refs/heads/master d3d269f93 -> 260fdc724
KNOX-366 fixed stale pid detection again Project: http://git-wip-us.apache.org/repos/asf/knox/repo Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/260fdc72 Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/260fdc72 Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/260fdc72 Branch: refs/heads/master Commit: 260fdc724dc48ceb7b576094e48dbd16b70aa80d Parents: d3d269f Author: Larry McCay <[email protected]> Authored: Mon Jun 23 20:50:05 2014 -0400 Committer: Larry McCay <[email protected]> Committed: Mon Jun 23 20:50:05 2014 -0400 ---------------------------------------------------------------------- gateway-release/home/bin/gateway.sh | 5 ++++- gateway-release/home/bin/ldap.sh | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/knox/blob/260fdc72/gateway-release/home/bin/gateway.sh ---------------------------------------------------------------------- diff --git a/gateway-release/home/bin/gateway.sh b/gateway-release/home/bin/gateway.sh index 769a269..e4cec6f 100755 --- a/gateway-release/home/bin/gateway.sh +++ b/gateway-release/home/bin/gateway.sh @@ -221,7 +221,10 @@ function getPID { APP_PID="$(<$APP_PID_FILE)" - if [ ! $APP_PID > /dev/null ]; + ps -p $APP_PID > /dev/null + # if the exit code was 1 then it isn't running + # and it is safe to start + if [ "$?" -eq "1" ]; then return 1 fi http://git-wip-us.apache.org/repos/asf/knox/blob/260fdc72/gateway-release/home/bin/ldap.sh ---------------------------------------------------------------------- diff --git a/gateway-release/home/bin/ldap.sh b/gateway-release/home/bin/ldap.sh index 78b6dfc..a51ef23 100755 --- a/gateway-release/home/bin/ldap.sh +++ b/gateway-release/home/bin/ldap.sh @@ -209,7 +209,10 @@ function getPID { APP_PID="$(<$APP_PID_FILE)" - if [ ! $APP_PID > /dev/null ]; + ps -p $APP_PID > /dev/null + # if the exit code was 1 then it isn't running + # and it is safe to start + if [ "$?" -eq "1" ]; then return 1 fi
