From de6f82008dfa3f1f0eb222dbd6152fc80c378c4f Mon Sep 17 00:00:00 2001 From: Jose Luis Franco Arza Date: Fri, 2 Nov 2018 15:52:59 +0100 Subject: [PATCH] Omit grep process in nova_api healthcheck. Currently, the nova_api healthcheck uses the output from the ps -ef command passing it to grep looking for the nova_metadata process. However, the way it's done currently would print out the grep commmand itself which would cause a false negative. ()[root@undercloud-0 /]# ps -ef | grep nova-metadata root 10979 8969 0 10:53 ? 00:00:00 grep --color=auto nova-metadata This patch uses pgrep intead, which does not create a grep process that could match the string, plus it provides a clearer idea on what we are trying to match. Change-Id: Id493b3d0088e44c831b138b4526681694481d0eb Closes-Bug: #1801365 --- healthcheck/nova-api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/healthcheck/nova-api b/healthcheck/nova-api index ef82ea7e7..c966d574d 100755 --- a/healthcheck/nova-api +++ b/healthcheck/nova-api @@ -3,7 +3,7 @@ . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh -if ps -ef | grep --quiet nova-metadata; then +if pgrep -f nova-metadata; then check_url=$(get_url_from_vhost /etc/httpd/conf.d/10-nova_metadata_wsgi.conf) else check_url=$(get_url_from_vhost /etc/httpd/conf.d/10-nova_api_wsgi.conf)