Skip to content

Commit

Permalink
Add check to use /tmp/supervisord_<>.sock if present
Browse files Browse the repository at this point in the history
After upgrade config files might still have old location for socket files.
Check if socket file is present in /tmp/, if not then use the one in /var/run.

Conflicts:
	contrail_provisioning/openstack/scripts/barbican-server-setup.sh (resolved)
	contrail_provisioning/vcenter_plugin/setup.py (not-applicable)

Change-Id: I95a04871950dd29c2104bb04d8ab25da12dfb1a0
Closes-Bug: #1663370
(cherry picked from commit c66b28b)
  • Loading branch information
Santosh Gupta committed Feb 15, 2017
1 parent 8810880 commit 7071916
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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}`
""")
Original file line number Diff line number Diff line change
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}`
""")
Original file line number Diff line number Diff line change
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 7071916

Please sign in to comment.