Merge "ensure that socat serial proxy keeps running"
This commit is contained in:
commit
ccf2bb1ea1
@ -305,9 +305,11 @@ def start_socat_console(node_uuid, port, console_cmd):
|
|||||||
|
|
||||||
console_host = CONF.console.socat_address
|
console_host = CONF.console.socat_address
|
||||||
if netutils.is_valid_ipv6(console_host):
|
if netutils.is_valid_ipv6(console_host):
|
||||||
arg = 'TCP6-LISTEN:%(port)s,bind=[%(host)s],reuseaddr'
|
arg = ('TCP6-LISTEN:%(port)s,bind=[%(host)s],reuseaddr,fork,'
|
||||||
|
'max-children=1')
|
||||||
else:
|
else:
|
||||||
arg = 'TCP4-LISTEN:%(port)s,bind=%(host)s,reuseaddr'
|
arg = ('TCP4-LISTEN:%(port)s,bind=%(host)s,reuseaddr,fork,'
|
||||||
|
'max-children=1')
|
||||||
args.append(arg % {'host': console_host,
|
args.append(arg % {'host': console_host,
|
||||||
'port': port})
|
'port': port})
|
||||||
|
|
||||||
|
@ -467,13 +467,15 @@ class ConsoleUtilsTestCase(db_base.DbTestCase):
|
|||||||
def test_start_socat_console_check_arg_bind_addr_default_ipv4(self):
|
def test_start_socat_console_check_arg_bind_addr_default_ipv4(self):
|
||||||
self.config(my_ip='10.0.0.1')
|
self.config(my_ip='10.0.0.1')
|
||||||
args = self._test_start_socat_console_check_arg()
|
args = self._test_start_socat_console_check_arg()
|
||||||
self.assertIn('TCP4-LISTEN:%s,bind=10.0.0.1,reuseaddr' %
|
self.assertIn('TCP4-LISTEN:%s,bind=10.0.0.1,reuseaddr,fork,'
|
||||||
|
'max-children=1' %
|
||||||
self.info['port'], args)
|
self.info['port'], args)
|
||||||
|
|
||||||
def test_start_socat_console_check_arg_bind_addr_ipv4(self):
|
def test_start_socat_console_check_arg_bind_addr_ipv4(self):
|
||||||
self.config(socat_address='10.0.0.1', group='console')
|
self.config(socat_address='10.0.0.1', group='console')
|
||||||
args = self._test_start_socat_console_check_arg()
|
args = self._test_start_socat_console_check_arg()
|
||||||
self.assertIn('TCP4-LISTEN:%s,bind=10.0.0.1,reuseaddr' %
|
self.assertIn('TCP4-LISTEN:%s,bind=10.0.0.1,reuseaddr,fork,'
|
||||||
|
'max-children=1' %
|
||||||
self.info['port'], args)
|
self.info['port'], args)
|
||||||
|
|
||||||
@mock.patch.object(os.path, 'exists', autospec=True)
|
@mock.patch.object(os.path, 'exists', autospec=True)
|
||||||
|
9
releasenotes/notes/socat-respawn-de9e8805c820a7ac.yaml
Normal file
9
releasenotes/notes/socat-respawn-de9e8805c820a7ac.yaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- Ironic does not monitor the socat proxy started for serial console
|
||||||
|
access. The socat process would exit on client disconnect, which
|
||||||
|
would (a) leave a zombie socat process in the process table and (b)
|
||||||
|
disable any subsequent serial console connections. Fixed the issue by
|
||||||
|
updating Ironic to call socat with the ``fork,max-children=1`` options,
|
||||||
|
which makes socat persist and accept multiple connections (but only one
|
||||||
|
at a time). See https://storyboard.openstack.org/#!/story/2005024.
|
Loading…
x
Reference in New Issue
Block a user