summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/vpn/process.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2017-08-24 01:31:23 -0400
committerKali Kaneko <kali@leap.se>2017-08-30 16:18:06 -0400
commit116af66d410ee3a4ee69a8fa25c6036ed1c2411f (patch)
tree189771e66ca4ef0d62096d14eb6638e6fd05eec2 /src/leap/bitmask/vpn/process.py
parent34d59f070d13ec2ac09c07cc7e0ec6a5d559fef9 (diff)
[refactor] restart by allowing to send SIGUSR1 to openvpn process
by properly allowing openvpn to restart when receiving SIGUSR1, we can reserve the hard process restarts for cases in which the process is aborted. this depends on bitmask-root adding --persist-tun and --persist-key as mandatory/allowed parameters.
Diffstat (limited to 'src/leap/bitmask/vpn/process.py')
-rw-r--r--src/leap/bitmask/vpn/process.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/leap/bitmask/vpn/process.py b/src/leap/bitmask/vpn/process.py
index 19115d6..b9c8456 100644
--- a/src/leap/bitmask/vpn/process.py
+++ b/src/leap/bitmask/vpn/process.py
@@ -252,7 +252,8 @@ class _VPNProcess(protocol.ProcessProtocol):
# shutdown
def terminate(self):
- self.proto.signal('SIGTERM')
+ if self.proto:
+ self.proto.signal('SIGTERM')
def kill(self):
try: