Workaround potential failure to shutdown services

Kill them twice to make sure they're good'n'dead. There is a supposed
fix to oslo-incubator code, but we're working around that here in the
meantime with this change.

This returned in Liberty.

Change-Id: I02a7af995dc7de857c4efcf2cef2f95d357c007a
Related-Bug: #1446583
This commit is contained in:
Dan Smith
2015-04-23 09:41:06 -07:00
committed by Sean Dague
parent 8dac66f087
commit d680e9b140

View File

@@ -1476,6 +1476,12 @@ function stop_process {
# Kill via pid if we have one available
if [[ -r $SERVICE_DIR/$SCREEN_NAME/$service.pid ]]; then
pkill -g $(cat $SERVICE_DIR/$SCREEN_NAME/$service.pid)
# TODO(danms): Remove this double-kill when we have
# this fixed in all services:
# https://bugs.launchpad.net/oslo-incubator/+bug/1446583
sleep 1
# /bin/true becakse pkill on a non existant process returns an error
pkill -g $(cat $SERVICE_DIR/$SCREEN_NAME/$service.pid) || /bin/true
rm $SERVICE_DIR/$SCREEN_NAME/$service.pid
fi
if [[ "$USE_SCREEN" = "True" ]]; then