Commit 8b32419e authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

If killing a container, do not exit with error if the

pidfile is gone, or the process is gone; both imply
the container is gone, so don't throw an error.
parent 76b0b04a
......@@ -246,7 +246,10 @@ my $alllogs = "$LOGDIR/tbvnode-${vnodeid}.all";
if ($killit || $haltit) {
if (! -e $pidfile) {
die("*** $0:\n".
" No pid for $vnodeid manager!\n");
" No pid for $vnodeid manager!\n")
if ($haltit);
# Not an error if not running.
exit(0);
}
exit(killvnode());
}
......@@ -610,6 +613,11 @@ sub killvnode(;$)
unlink($pidfile);
}
elsif (kill($sigtosend, $mpid) == 0) {
# No worries if killing it, just return.
if ($!{ESRCH} && !$haltit) {
unlink($pidfile);
return 0;
}
print"*** Could not kill($sigtosend) process $mpid: $!\n";
return -1;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment