Commit 1f36db14 authored by Ulysse Beaugnon's avatar Ulysse Beaugnon

Clients disconnection can now be detected without waiting 2 min (approx 2 sec now)

This information is passed to the application
parent ec50944f
#!/usr/bin/python -S
import os, sys
os.write(int(sys.argv[1]), 'CLIENT_DISCONNECTED ' + os.environ['trusted_ip'] + '\n')
...@@ -8,6 +8,12 @@ def openvpn(*args, **kw): ...@@ -8,6 +8,12 @@ def openvpn(*args, **kw):
'--persist-key', '--persist-key',
'--script-security', '2', '--script-security', '2',
'--user', 'nobody', '--user', 'nobody',
'--ping', '0.5',
# I don't kown how Babel works, but if it test the
# connection often, the ping directive might not be needed
# if it test the connection very often, we could also decrease
# ping-exit to 1 sec
'--ping-exit', '2',
'--group', 'nogroup', '--group', 'nogroup',
'--verb', str(config.verbose), '--verb', str(config.verbose),
] + list(args) + config.openvpn_args ] + list(args) + config.openvpn_args
...@@ -21,7 +27,6 @@ def openvpn(*args, **kw): ...@@ -21,7 +27,6 @@ def openvpn(*args, **kw):
def server(ip, pipe_fd, *args, **kw): def server(ip, pipe_fd, *args, **kw):
return openvpn( return openvpn(
'--tls-server', '--tls-server',
'--keepalive', '10', '60',
'--mode', 'server', '--mode', 'server',
'--duplicate-cn', # XXX : to be removed '--duplicate-cn', # XXX : to be removed
'--up', 'up-server ' + ip, '--up', 'up-server ' + ip,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment