Skip to content

Commit

Permalink
Merge "Add check to use /tmp/supervisord_<>.sock if present"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Feb 17, 2017
2 parents 60dbd01 + 7071916 commit c720526
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
10 changes: 5 additions & 5 deletions contrail_provisioning/common/rabbitmq.py
Expand Up @@ -102,12 +102,12 @@ def listen_at_supervisor_support_port(self):
is_running = "service supervisor-support-service status | grep running"
if local(is_running).failed:
local("service supervisor-support-service start")
sock = "unix:///var/run/supervisord_support_service.sock"
stop_all = "supervisorctl -s %s stop all" % sock
if local(stop_all).failed:
if os.path.exists('/tmp/supervisord_support_service.sock'):
sock = "unix:///tmp/supervisord_support_service.sock"
else:
sock = "unix:///var/run/supervisord_support_service.sock"
stop_all = "supervisorctl -s %s stop all" % sock
local(stop_all)
stop_all = "supervisorctl -s %s stop all" % sock
local(stop_all)

def remove_mnesia_database(self):
with settings(warn_only=True):
Expand Down
5 changes: 4 additions & 1 deletion contrail_provisioning/config/templates/contrail_api_svc.py
Expand Up @@ -8,5 +8,8 @@
$__contrail_supervisorctl_lines__
#supervisorctl -s unix:///tmp/supervisord_config.sock ${1} `basename ${0}`
#if os.path.exists('/tmp/supervisord_config.sock'):
# supervisorctl -s unix:///tmp/supervisord_config.sock ${1} `basename ${0}`
#else:
# supervisorctl -s unix:///var/run/supervisord_config.sock ${1} `basename ${0}`
""")
Expand Up @@ -8,5 +8,8 @@
$__contrail_supervisorctl_lines__
#supervisorctl -s unix:///tmp/supervisord_config.sock ${1} `basename ${0}`
#if os.path.exists('/tmp/supervisord_config.sock'):
# supervisorctl -s unix:///tmp/supervisord_config.sock ${1} `basename ${0}`
#else:
# supervisorctl -s unix:///var/run/supervisord_config.sock ${1} `basename ${0}`
""")
Expand Up @@ -174,7 +174,11 @@ if [ $is_xenial -ne 1 ] ; then
if [ $status == 'stopped' ]; then
service supervisor-openstack start
sleep 5
supervisorctl -s unix:///tmp/supervisord_openstack.sock stop all
if [ -e /tmp/supervisord_openstack.sock ]; then
supervisorctl -s unix:///tmp/supervisord_openstack.sock stop all
else
supervisorctl -s unix:///var/run/supervisord_openstack.sock stop all
fi
fi
fi

Expand Down

0 comments on commit c720526

Please sign in to comment.