Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the pid occupied check when use bookkeeper-daemon.sh start or stop (
#3113) Master Issue: #3112 ### Motivation Fix the failed pid occupied check. we'll fail when use bookkeeper-daemon.sh start or stop bookie, after the last time we exit the bookie direct kill or the bookie occurred non-normal exit, then the bin/bookkeeper-bookie.pid are retained, and the pid in the file is occupied by the thread in other progress. ### Changes Change the pid occupied check from 'kill -0 $pid' to 'ps -p $pid'. The both will return true when the pid is occupied by one progress, but 'kill -0 $pid' will return true and the 'ps -p $pid' will return false when the pid is occupied by one progress's sub thread. StackOverflow discussion: https://stackoverflow.com/questions/30958964/why-do-kill-0-pid-echo-and-ps-ppid-echo-sometimes-differ Co-authored-by: nicklixinyang <[email protected]>
- Loading branch information