Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check that at least the pid belongs to a java process before killing it #246

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
13 changes: 13 additions & 0 deletions bin/bpipe
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,19 @@ is_running() {
# Sets LAST_PID
get_last_run_pid

# Check that the pid actually belongs to a running bpipe
PID_IS_BPIPE=0
for PID in $(pidof java); do
if [ "x$LAST_PID" == "x$PID" ];
then
PID_IS_BPIPE=1
fi
done
if [ $PID_IS_BPIPE == 0 ];
then
LAST_PID="-1"
fi

# Never run before?
if [ "$LAST_PID" == "-1" ];
then
Expand Down