summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/vpn/_control.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2017-06-08 15:36:37 -0700
committerKali Kaneko (leap communications) <kali@leap.se>2017-06-09 00:48:40 +0200
commita003e13cec2c44160b46047d0fee8d52dfc6253f (patch)
tree6322f118707e5ce5da435873744024eee9afb3d6 /src/leap/bitmask/vpn/_control.py
parent6f961fc09dd633d0bcf5397787139c0032e0661e (diff)
[bug] make openvpn and firewall able to launch
with these fixes, I'm able to finally launch openvpn and firewall on osx. :) all that's left for a minimum vpn release is packaging and installing all the helpers in the proper place.
Diffstat (limited to 'src/leap/bitmask/vpn/_control.py')
-rw-r--r--src/leap/bitmask/vpn/_control.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/leap/bitmask/vpn/_control.py b/src/leap/bitmask/vpn/_control.py
index 74182a9e..bf33b1bc 100644
--- a/src/leap/bitmask/vpn/_control.py
+++ b/src/leap/bitmask/vpn/_control.py
@@ -54,7 +54,7 @@ class VPNControl(object):
args = [self._vpnconfig, self._providerconfig, self._host,
self._port]
- kwargs = {'openvpn_verb': 7, 'remotes': self._remotes,
+ kwargs = {'openvpn_verb': 4, 'remotes': self._remotes,
'restartfun': self.restart}
vpnproc = VPNProcess(*args, **kwargs)
@@ -63,6 +63,11 @@ class VPNControl(object):
vpnproc.stop_if_already_running()
try:
+ vpnproc.preUp()
+ except Exception as e:
+ log.error('Error on vpn pre-up {0!r}'.format(e))
+ raise
+ try:
cmd = vpnproc.getCommand()
except Exception as e:
log.error('Error while getting vpn command... {0!r}'.format(e))
@@ -70,7 +75,8 @@ class VPNControl(object):
env = os.environ
- reactor.spawnProcess(vpnproc, cmd[0], cmd, env)
+ runningproc = reactor.spawnProcess(vpnproc, cmd[0], cmd, env)
+ vpnproc.pid = runningproc.pid
self._vpnproc = vpnproc
# add pollers for status and state