Browse code

Use uwsgi binary from path

All these uwsgi invocations assume that the uwsgi binary is in the
same directory as their project binaries are installed into (probably
/usr/bin). That may not be correct -- for example if using a packaged
uwsgi on Fedora the binary will live in /usr/sbin/uwsgi (not /usr/bin
where the project files from pip are).

Switch invocations to just find it in the path.

Change-Id: I298e3374e9c84e209ffcabbaaacda17f8df19f4f

Ian Wienand authored on 2018/06/22 21:23:29
Showing 7 changed files
... ...
@@ -492,7 +492,7 @@ function start_cinder {
492 492
                 start_tls_proxy cinder '*' $CINDER_SERVICE_PORT $CINDER_SERVICE_HOST $CINDER_SERVICE_PORT_INT
493 493
             fi
494 494
         else
495
-            run_process "c-api" "$CINDER_BIN_DIR/uwsgi --procname-prefix cinder-api --ini $CINDER_UWSGI_CONF"
495
+            run_process "c-api" "$(which uwsgi) --procname-prefix cinder-api --ini $CINDER_UWSGI_CONF"
496 496
             cinder_url=$service_protocol://$SERVICE_HOST/volume/v3
497 497
         fi
498 498
     fi
... ...
@@ -392,7 +392,7 @@ function start_glance {
392 392
 
393 393
     run_process g-reg "$GLANCE_BIN_DIR/glance-registry --config-file=$GLANCE_CONF_DIR/glance-registry.conf"
394 394
     if [[ "$WSGI_MODE" == "uwsgi" ]]; then
395
-        run_process g-api "$GLANCE_BIN_DIR/uwsgi --procname-prefix glance-api --ini $GLANCE_UWSGI_CONF"
395
+        run_process g-api "$(which uwsgi) --procname-prefix glance-api --ini $GLANCE_UWSGI_CONF"
396 396
     else
397 397
         run_process g-api "$GLANCE_BIN_DIR/glance-api --config-dir=$GLANCE_CONF_DIR"
398 398
     fi
... ...
@@ -523,7 +523,7 @@ function start_keystone {
523 523
         enable_apache_site keystone
524 524
         restart_apache_server
525 525
     else # uwsgi
526
-        run_process keystone "$KEYSTONE_BIN_DIR/uwsgi --procname-prefix keystone --ini $KEYSTONE_PUBLIC_UWSGI_CONF" ""
526
+        run_process keystone "$(which uwsgi) --procname-prefix keystone --ini $KEYSTONE_PUBLIC_UWSGI_CONF" ""
527 527
     fi
528 528
 
529 529
     echo "Waiting for keystone to start..."
... ...
@@ -463,7 +463,7 @@ function start_neutron_api {
463 463
     done
464 464
 
465 465
     if [ "$NEUTRON_DEPLOY_MOD_WSGI" == "True" ]; then
466
-        run_process neutron-api "$NEUTRON_BIN_DIR/uwsgi --procname-prefix neutron-api --ini $NEUTRON_UWSGI_CONF"
466
+        run_process neutron-api "$(which uwsgi) --procname-prefix neutron-api --ini $NEUTRON_UWSGI_CONF"
467 467
         neutron_url=$service_protocol://$NEUTRON_SERVICE_HOST/networking/
468 468
         enable_service neutron-rpc-server
469 469
         run_process neutron-rpc-server "$NEUTRON_BIN_DIR/neutron-rpc-server $opts"
... ...
@@ -477,7 +477,7 @@ function start_neutron_service_and_check {
477 477
     # Start the Neutron service
478 478
     if [ "$NEUTRON_DEPLOY_MOD_WSGI" == "True" ]; then
479 479
         enable_service neutron-api
480
-        run_process neutron-api "$NEUTRON_BIN_DIR/uwsgi --procname-prefix neutron-api --ini $NEUTRON_UWSGI_CONF"
480
+        run_process neutron-api "$(which uwsgi) --procname-prefix neutron-api --ini $NEUTRON_UWSGI_CONF"
481 481
         neutron_url=$Q_PROTOCOL://$Q_HOST/networking/
482 482
         enable_service neutron-rpc-server
483 483
         run_process neutron-rpc-server "$NEUTRON_BIN_DIR/neutron-rpc-server $cfg_file_options"
... ...
@@ -864,7 +864,7 @@ function start_nova_api {
864 864
             start_tls_proxy nova '*' $NOVA_SERVICE_PORT $NOVA_SERVICE_HOST $NOVA_SERVICE_PORT_INT
865 865
         fi
866 866
     else
867
-        run_process "n-api" "$NOVA_BIN_DIR/uwsgi --procname-prefix nova-api --ini $NOVA_UWSGI_CONF"
867
+        run_process "n-api" "$(which uwsgi) --procname-prefix nova-api --ini $NOVA_UWSGI_CONF"
868 868
         nova_url=$service_protocol://$SERVICE_HOST/compute/v2.1/
869 869
     fi
870 870
 
... ...
@@ -955,7 +955,7 @@ function start_nova_rest {
955 955
     if [ "$NOVA_USE_MOD_WSGI" == "False" ]; then
956 956
         run_process n-api-meta "$NOVA_BIN_DIR/nova-api-metadata --config-file $compute_cell_conf"
957 957
     else
958
-        run_process n-api-meta "$NOVA_BIN_DIR/uwsgi --procname-prefix nova-api-meta --ini $NOVA_METADATA_UWSGI_CONF"
958
+        run_process n-api-meta "$(which uwsgi) --procname-prefix nova-api-meta --ini $NOVA_METADATA_UWSGI_CONF"
959 959
     fi
960 960
 
961 961
     export PATH=$old_path
... ...
@@ -144,7 +144,7 @@ function install_placement {
144 144
 # start_placement_api() - Start the API processes ahead of other things
145 145
 function start_placement_api {
146 146
     if [[ "$WSGI_MODE" == "uwsgi" ]]; then
147
-        run_process "placement-api" "$PLACEMENT_BIN_DIR/uwsgi --procname-prefix placement --ini $PLACEMENT_UWSGI_CONF"
147
+        run_process "placement-api" "$(which uwsgi) --procname-prefix placement --ini $PLACEMENT_UWSGI_CONF"
148 148
     else
149 149
         enable_apache_site placement-api
150 150
         restart_apache_server