From 0df3ebd7592eac90f76650770f59c89fba4ebe39 Mon Sep 17 00:00:00 2001 From: Daniel Alvarez Date: Thu, 19 Mar 2020 12:21:15 +0100 Subject: [PATCH] Filter out wrapper commands from the ps output This patch is filtering out the wrapper execution from the ps output in the sync script. By doing this, it'll effectively detect when the target process is not running and start it. Otherwise, there might be cases where the process start is postponed until next iteration of the sync script (1 minute) and it may be already too late. This is causing tests to fail as the metadata service is not provisioned in time for instances to fetch their SSH keys. Change-Id: I530e257f343ffc551db9e984f9a27b20c397bfb1 Co-Authored-By: Jakub Libosvar Closes-Bug: #1868082 Signed-off-by: Daniel Alvarez --- .../roles/tripleo_systemd_wrapper/templates/service_sync.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tripleo_ansible/roles/tripleo_systemd_wrapper/templates/service_sync.j2 b/tripleo_ansible/roles/tripleo_systemd_wrapper/templates/service_sync.j2 index 63b46d5a3..5ce5af03f 100644 --- a/tripleo_ansible/roles/tripleo_systemd_wrapper/templates/service_sync.j2 +++ b/tripleo_ansible/roles/tripleo_systemd_wrapper/templates/service_sync.j2 @@ -41,7 +41,7 @@ for LINE in $(cat {{ tripleo_systemd_wrapper_service_dir }}/{{ tripleo_systemd_w NETNS=$(echo $LINE | awk '{ print $1 }') IFS=$' ' ARGS=$(echo $LINE | sed -e "s|$NETNS ||" | xargs) # TODO(emilien) investigate if we should rather run docker/podman ps instead of ps on the host - if ! ps -e -o pid,command | grep "$(echo $NETNS | sed 's|^[^-]*\-||')" | grep -v grep &> /dev/null; then + if ! ps -e -o pid,command | grep "$(echo $NETNS | sed 's|^[^-]*\-||')" | egrep -v "grep | netns exec" &> /dev/null; then start_service $NETNS $ARGS fi done