aboutsummaryrefslogtreecommitdiffstats
path: root/container-core
diff options
context:
space:
mode:
authorEirik Nygaard <eirik.nygaard@yahooinc.com>2022-03-07 12:37:43 +0100
committerEirik Nygaard <eirik.nygaard@yahooinc.com>2022-03-07 12:41:45 +0100
commit7bd5214ed47688c29be1499147127fed2289d9e1 (patch)
treeba6ebacbebfdeb544ab3659c6f7f4231fdc31bb1 /container-core
parent5ead84bb17aa1ebb39d934d9b74d2d6ef758d566 (diff)
Ensure we match the service name exactly
Services 'container' and 'metrisproxy-container' would both match for "container". Which one was chosen would depend on the order they were returned from the sentinel.
Diffstat (limited to 'container-core')
-rwxr-xr-xcontainer-core/src/main/sh/find-pid2
1 files changed, 1 insertions, 1 deletions
diff --git a/container-core/src/main/sh/find-pid b/container-core/src/main/sh/find-pid
index 56c387387d4..4db6562db1b 100755
--- a/container-core/src/main/sh/find-pid
+++ b/container-core/src/main/sh/find-pid
@@ -87,7 +87,7 @@ if [ -f "$pid_file" ]; then
parent_pid=$(cat "$pid_file")
pid=$(pgrep --parent $parent_pid)
else
- status=$(vespa-sentinel-cmd list 2>/dev/null | grep --perl-regexp "($service state=|id=\"$service\")")
+ status=$(vespa-sentinel-cmd list 2>/dev/null | grep --perl-regexp "(^$service state=|id=\"$service\")")
if [ -z "${status}" ]; then
echo "No service with name or config id '${service}'" >&2
exit 1