Fix management of Blazar services by DevStack

Calls to screen_it and screen_stop should be replaced by run_process and
stop_process, as in Ia3843818014f7c6c7526ef3aa9676bbddb8a85ca. While
this code worked fine with screen, DevStack now defaults to managing
services with systemd.

This patch ensures Blazar services are correctly launched and stopped,
whether using systemd or screen.

Change-Id: I99744a2e2adc46682f2ff78bdf0b09608d83d9c2
Closes-Bug: #1691425
This commit is contained in:
Pierre Riteau 2017-05-17 12:45:44 +01:00
parent 726d5f39d0
commit b9e5a33c66
1 changed files with 3 additions and 9 deletions

View File

@ -169,22 +169,16 @@ function install_blazar {
# start_blazar() - Start running processes, including screen
function start_blazar {
screen_it blazar-a "cd $BLAZAR_DIR && $BLAZAR_BIN_DIR/blazar-api --debug --config-file $BLAZAR_CONF_FILE"
screen_it blazar-m "cd $BLAZAR_DIR && $BLAZAR_BIN_DIR/blazar-manager --debug --config-file $BLAZAR_CONF_FILE"
run_process blazar-a "$BLAZAR_BIN_DIR/blazar-api --debug --config-file $BLAZAR_CONF_FILE"
run_process blazar-m "$BLAZAR_BIN_DIR/blazar-manager --debug --config-file $BLAZAR_CONF_FILE"
}
# stop_blazar() - Stop running processes
function stop_blazar {
# Kill the blazar screen windows
for serv in blazar-a blazar-m; do
screen_stop $serv
stop_process $serv
done
# Hack to be sure that the manager is really stop
BLAZAR_MANGER_PID=$(ps aux | grep blazar-manager | grep -v grep \
| awk '{print $2}')
[ ! -z "$BLAZAR_MANGER_PID" ] && sudo kill -9 $BLAZAR_MANGER_PID
}