From 6e9e512cccf0180707abbc52d79f622f9575c1b1 Mon Sep 17 00:00:00 2001 From: mantaohuang Date: Fri, 3 Apr 2020 22:29:12 -0400 Subject: [PATCH] fix kill signal --- openvpn.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openvpn.py b/openvpn.py index 757c9a9..81b2e7a 100644 --- a/openvpn.py +++ b/openvpn.py @@ -6,6 +6,7 @@ import tempfile import os import time import openvpn_api +import signal def generate_config(in_fp, cfg): @@ -94,7 +95,7 @@ class Openvpn: async def stop(self): if self.status == RUNNING: try: - os.kill(self.PID) + os.kill(self.PID, signal.SIGKILL) except Exception as err: print("kill failed:", err)