Remove 'fork' option from socat command

socat should not forks for each new connection.
After this change socat console will be available only for single user
connection and will be closed after user connection close.
To connect again, user should re-activate console.
This already covered in nova virt driver.

Also added timeout check for 600 sec for user's connection.

Change-Id: If92b3a9cff2d0fc1280f8e9dfc4bc8fa100c91ec
Closes-bug: #1611279
This commit is contained in:
Andrey Shestakov 2016-10-20 14:15:44 +03:00
parent 8dcaf82100
commit cc88ce14db
2 changed files with 14 additions and 2 deletions

View File

@ -282,13 +282,17 @@ def start_socat_console(node_uuid, port, console_cmd):
# put together the command and arguments for invoking the console
args = ['socat']
# set timeout check for user's connection. After 10min of inactivity
# on client side, connection will be closed.
# TODO(ashestakov) Make timeout value configurable
args.append('-T600')
args.append('-L%s' % pid_file)
console_host = CONF.my_ip
if netutils.is_valid_ipv6(console_host):
arg = 'TCP6-LISTEN:%(port)s,bind=[%(host)s],reuseaddr,fork'
arg = 'TCP6-LISTEN:%(port)s,bind=[%(host)s],reuseaddr'
else:
arg = 'TCP4-LISTEN:%(port)s,bind=%(host)s,reuseaddr,fork'
arg = 'TCP4-LISTEN:%(port)s,bind=%(host)s,reuseaddr'
args.append(arg % {'host': console_host,
'port': port})

View File

@ -0,0 +1,8 @@
---
fixes:
- Fixes issue with socat console support where an unlimited
number of connections could be created, resulting in the prior
session being destroyed. Connections are now limited
to a single connection per server. Socat now closes the
console connection upon disconnect or timeout 10min. To reconnect,
users should re-activate the console.