diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2021-08-27 16:03:43 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2021-08-27 16:58:47 +0200 |
commit | 7f8b04cad8adf56d9cc0c8380cbc708bf4b2ed01 (patch) | |
tree | 950cbd425cc904c0d0e4fef2cf182ae7ff7d0a84 /container-core/src | |
parent | f1119897f4681a32c582d6e0bac2ac5e67e00c08 (diff) |
Fix check for process running
Diffstat (limited to 'container-core/src')
-rwxr-xr-x | container-core/src/main/sh/vespa-jvm-heap-dumper | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/container-core/src/main/sh/vespa-jvm-heap-dumper b/container-core/src/main/sh/vespa-jvm-heap-dumper index a6d9dd5df49..8157fe5580d 100755 --- a/container-core/src/main/sh/vespa-jvm-heap-dumper +++ b/container-core/src/main/sh/vespa-jvm-heap-dumper @@ -74,7 +74,7 @@ findhost # END environment bootstrap section -set -e +set -euo pipefail if [ $# -ne 2 ]; then echo "Usage: $0 <service> <output-file>" @@ -101,8 +101,7 @@ if test -f "${OUTPUT_FILE}"; then echo "Overwriting existing file ${OUTPUT_FILE}" rm "${OUTPUT_FILE}" fi -readonly PROCESS=$(ps -p ${JVM_PID} 2>&1) -if [ -z "${PROCESS}" ]; then +if ! [ -n $(ps -p ${JVM_PID} -o pid=) ]; then echo "Could not find process for '${JVM_PID}'" exit 1 fi |