Already dead process tolerance in unstack.sh

The gate/updown.sh calls the unstack.sh with
-ex option. Normally we do not use -e with unstack.sh.

The unstack.sh can fail if the service already stopped,
and it also can have flaky failures on the gate.

For example the stop_swift function tries to kill swift in two
different ways, and if the first one succeeds before the 2th attempt
the pkill fails the whole unstack.sh.

This change accepts kill failure.
Normally the kill can fail if the process does not exits,
or when you do not have permission to the kill operation.

Since the permission issue is very unlikely in our case,
this change does not tries to distinguish the two operation.

The behavior of the unstack.sh wen you are not using -ex should
not be changed by this change.

Change-Id: I64bf3cbe1b60c96f5b271dcfb620c3d4b50de26b
This commit is contained in:
Attila Fazekas 2015-07-01 12:17:35 +02:00
parent 85a1c488df
commit f750a6fedb
3 changed files with 3 additions and 3 deletions

View File

@ -1342,7 +1342,7 @@ function screen_stop_service {
if is_service_enabled $service; then if is_service_enabled $service; then
# Clean up the screen window # Clean up the screen window
screen -S $SCREEN_NAME -p $service -X kill screen -S $SCREEN_NAME -p $service -X kill || true
fi fi
} }

View File

@ -42,7 +42,7 @@ function neutron_agent_lbaas_configure_agent {
function neutron_lbaas_stop { function neutron_lbaas_stop {
pids=$(ps aux | awk '/haproxy/ { print $2 }') pids=$(ps aux | awk '/haproxy/ { print $2 }')
[ ! -z "$pids" ] && sudo kill $pids [ ! -z "$pids" ] && sudo kill $pids || true
} }
# Restore xtrace # Restore xtrace

View File

@ -772,7 +772,7 @@ function stop_swift {
stop_process s-${type} stop_process s-${type}
done done
# Blast out any stragglers # Blast out any stragglers
pkill -f swift- pkill -f swift- || true
} }
function swift_configure_tempurls { function swift_configure_tempurls {