From 6acf5ddfaf8e091f6b05b814128ac4f38b19c191 Mon Sep 17 00:00:00 2001 From: kali Date: Tue, 8 Aug 2017 09:07:09 -0700 Subject: [bug] proper vpn shutdown in osx bundles the restarting flag was not being set. - Resolves: #8959 --- src/leap/bitmask/vpn/_control.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/leap/bitmask/vpn/_control.py') diff --git a/src/leap/bitmask/vpn/_control.py b/src/leap/bitmask/vpn/_control.py index 7f80f40b..7cf41d1f 100644 --- a/src/leap/bitmask/vpn/_control.py +++ b/src/leap/bitmask/vpn/_control.py @@ -90,7 +90,8 @@ class VPNControl(object): # this could be extended to a collection of # generic watchers - poll_list = [LoopingCall(vpnproc.pollStatus), + poll_list = [ + LoopingCall(vpnproc.pollStatus), LoopingCall(vpnproc.pollState), LoopingCall(vpnproc.pollLog)] self._pollers.extend(poll_list) @@ -115,6 +116,11 @@ class VPNControl(object): :param restart: whether this stop is part of a hard restart. :type restart: bool """ + # We assume that the only valid stops are initiated + # by an user action, not hard restarts + self._user_stopped = not restart + self._vpnproc.restarting = restart + self._stop_pollers() try: self._vpnproc.preDown() @@ -127,15 +133,10 @@ class VPNControl(object): # TODO factor this out to a linux-only launcher mechanism. # First we try to be polite and send a SIGTERM... if self._vpnproc is not None: - # We assume that the only valid stops are initiated - # by an user action, not hard restarts - self._user_stopped = not restart - self._vpnproc.restarting = restart - self._sentterm = True self._vpnproc.terminate(shutdown=shutdown) - # ...but we also trigger a countdown to be unpolite + # we trigger a countdown to be unpolite # if strictly needed. d = defer.Deferred() reactor.callLater( -- cgit v1.2.3