From a6721ae4168680431604e7e9426c311613287ce8 Mon Sep 17 00:00:00 2001 From: Peter Mikus Date: Tue, 12 Nov 2019 07:48:57 +0000 Subject: FIX: Supervisor initialization - Next step: remove supervisor entirely Signed-off-by: Peter Mikus Change-Id: I7ff5d76168d5d0f77e335975552638efac77cfc8 --- resources/libraries/python/ContainerUtils.py | 43 ++++++++++++++-------------- 1 file changed, 21 insertions(+), 22 deletions(-) (limited to 'resources') diff --git a/resources/libraries/python/ContainerUtils.py b/resources/libraries/python/ContainerUtils.py index 50868cb8f2..61409ff908 100644 --- a/resources/libraries/python/ContainerUtils.py +++ b/resources/libraries/python/ContainerUtils.py @@ -27,7 +27,7 @@ from resources.libraries.python.VppConfigGenerator import VppConfigGenerator __all__ = ["ContainerManager", "ContainerEngine", "LXC", "Docker", "Container"] -SUPERVISOR_CONF = '/etc/supervisord.conf' +SUPERVISOR_CONF = '/etc/supervisor/supervisord.conf' class ContainerManager(object): @@ -397,29 +397,29 @@ class ContainerEngine(object): if isinstance(self, LXC): self.execute('sleep 3; apt-get update') self.execute('apt-get install -y supervisor') - self.execute('echo "{config}" > {config_file} && ' - 'unlink /tmp/supervisor.sock && ' - 'supervisord -c {config_file}'. - format( - config='[unix_http_server]\n' - 'file = /tmp/supervisor.sock\n\n' - '[rpcinterface:supervisor]\n' - 'supervisor.rpcinterface_factory = ' - 'supervisor.rpcinterface:make_main_rpcinterface\n\n' - '[supervisorctl]\n' - 'serverurl = unix:///tmp/supervisor.sock\n\n' - '[supervisord]\n' - 'pidfile = /tmp/supervisord.pid\n' - 'identifier = supervisor\n' - 'directory = /tmp\n' - 'logfile = /tmp/supervisord.log\n' - 'loglevel = debug\n' - 'nodaemon = false\n\n', - config_file=SUPERVISOR_CONF)) + self.execute('echo "{config}" > {config_file} && ' + 'supervisord -c {config_file}'. + format( + config='[unix_http_server]\n' + 'file = /tmp/supervisor.sock\n\n' + '[rpcinterface:supervisor]\n' + 'supervisor.rpcinterface_factory = supervisor.' + 'rpcinterface:make_main_rpcinterface\n\n' + '[supervisorctl]\n' + 'serverurl = unix:///tmp/supervisor.sock\n\n' + '[supervisord]\n' + 'pidfile = /tmp/supervisord.pid\n' + 'identifier = supervisor\n' + 'directory = /tmp\n' + 'logfile = /tmp/supervisord.log\n' + 'loglevel = debug\n' + 'nodaemon = false\n\n', + config_file=SUPERVISOR_CONF)) def start_vpp(self): """Start VPP inside a container.""" - self.execute('echo "{config}" >> {config_file}'. + self.execute('echo "{config}" >> {config_file} && ' + 'supervisorctl reload'. format( config='[program:vpp]\n' 'command = /usr/bin/vpp -c /etc/vpp/startup.conf\n' @@ -428,7 +428,6 @@ class ContainerEngine(object): 'redirect_stderr = true\n' 'priority = 1', config_file=SUPERVISOR_CONF)) - self.execute('supervisorctl reload') self.execute('supervisorctl start vpp') from robot.libraries.BuiltIn import BuiltIn -- cgit 1.2.3-korg