From 39918c82d3637f44be05615efc5c329f4acd16b3 Mon Sep 17 00:00:00 2001 From: Eva Balycheva Date: Mon, 19 Oct 2015 02:02:04 +0300 Subject: [PATCH] Correctly stop uwsgi process during unstack.sh When using Zaqar as plugin in DevStack, after executing unstack.sh, there's still Zaqar uwsgi master process with it's workers running: /usr/local/bin/uwsgi --ini /etc/zaqar/uwsgi.conf This process must be stopped. Also running uwsgi process will prevent Zaqar to start on the next execution of stack.sh. The problem occurs, because of the nature of uwsgi container. It just can't be stopped like that: https://github.com/openstack/zaqar/blob/master/devstack/plugin.sh#L253 It must be stopped as described in uwsgi documentation: https://uwsgi-docs.readthedocs.org/en/latest/Management.html This commit will make uwsgi container process stop correctly on unstack.sh execution by using PID of the process as described in uwsgi documentation. Change-Id: I2f39ea5880c2153fa14a8308d8710969ef6a1a5e Closes-Bug: 1504854 --- devstack/plugin.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 1ab6905f7..57bffde5d 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -39,6 +39,7 @@ ZAQAR_CONF_DIR=/etc/zaqar ZAQAR_CONF=$ZAQAR_CONF_DIR/zaqar.conf ZAQAR_POLICY_CONF=$ZAQAR_CONF_DIR/policy.json ZAQAR_UWSGI_CONF=$ZAQAR_CONF_DIR/uwsgi.conf +ZAQAR_UWSGI_MASTER_PIDFILE=/tmp/uwsgizaqarmasterprocess.pid ZAQAR_API_LOG_DIR=/var/log/zaqar ZAQAR_API_LOG_FILE=$ZAQAR_API_LOG_DIR/queues.log ZAQAR_AUTH_CACHE_DIR=${ZAQAR_AUTH_CACHE_DIR:-/var/cache/zaqar} @@ -236,7 +237,7 @@ function install_zaqarclient { # start_zaqar() - Start running processes, including screen function start_zaqar { - run_process zaqar-wsgi "uwsgi --ini $ZAQAR_UWSGI_CONF" + run_process zaqar-wsgi "uwsgi --ini $ZAQAR_UWSGI_CONF --pidfile2 $ZAQAR_UWSGI_MASTER_PIDFILE" run_process zaqar-websocket "zaqar-server --config-file $ZAQAR_CONF" echo "Waiting for Zaqar to start..." @@ -253,6 +254,7 @@ function stop_zaqar { for serv in zaqar-wsgi zaqar-websocket; do screen -S $SCREEN_NAME -p $serv -X kill done + uwsgi --stop $ZAQAR_UWSGI_MASTER_PIDFILE } function create_zaqar_accounts {