diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2021-08-27 15:49:47 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2021-08-27 15:49:47 +0200 |
commit | f1119897f4681a32c582d6e0bac2ac5e67e00c08 (patch) | |
tree | b5ef5961240b846182a9f42a47384a28ed1df3b4 /container-core | |
parent | 3ad15bbe83dac3697b739ac5cc829e8037ebc468 (diff) |
Improve validation of pid
Diffstat (limited to 'container-core')
-rwxr-xr-x | container-core/src/main/sh/vespa-jvm-heap-dumper | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/container-core/src/main/sh/vespa-jvm-heap-dumper b/container-core/src/main/sh/vespa-jvm-heap-dumper index 3254b708304..a6d9dd5df49 100755 --- a/container-core/src/main/sh/vespa-jvm-heap-dumper +++ b/container-core/src/main/sh/vespa-jvm-heap-dumper @@ -91,8 +91,8 @@ else echo "Found service: ${STATUS}" fi readonly JVM_PID=$(echo ${STATUS} | cut -d " " -f 4 | cut -d "=" -f 2) -if [ -z "${JVM_PID}" ]; then - echo "Could not find pid for '${SERVICE}'" +if ! [[ "${JVM_PID}" =~ ^[0-9]+$ ]]; then + echo "Could not find valid pid for '${SERVICE}' (pid='${JVM_PID}')" exit 1 else echo "Pid for '${SERVICE}' is '${JVM_PID}'" |