Merge "Filter out wrapper commands from the ps output"

This commit is contained in:
Zuul 2020-03-20 13:46:49 +00:00 committed by Gerrit Code Review
commit 81b3a4c4a0
1 changed files with 1 additions and 1 deletions

View File

@ -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