summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-openvpn.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-11-15 21:19:51 +0100
committerChristian Poessinger <christian@poessinger.com>2021-11-15 21:20:57 +0100
commiteceaa3a787929f5a514b9c45da52936c0d4d4a54 (patch)
treee68737cd9b7b140a2f57ed521b4567166138caad /src/conf_mode/interfaces-openvpn.py
parentba476efa31ba175bf3f2c8084fdc5cdd962104d7 (diff)
downloadvyos-1x-eceaa3a787929f5a514b9c45da52936c0d4d4a54.tar.gz
vyos-1x-eceaa3a787929f5a514b9c45da52936c0d4d4a54.zip
openvpn: T3995: implement systemd reload support
Diffstat (limited to 'src/conf_mode/interfaces-openvpn.py')
-rwxr-xr-xsrc/conf_mode/interfaces-openvpn.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/conf_mode/interfaces-openvpn.py b/src/conf_mode/interfaces-openvpn.py
index 1e76147dd..3b8fae710 100755
--- a/src/conf_mode/interfaces-openvpn.py
+++ b/src/conf_mode/interfaces-openvpn.py
@@ -634,10 +634,10 @@ def generate(openvpn):
def apply(openvpn):
interface = openvpn['ifname']
- call(f'systemctl stop openvpn@{interface}.service')
# Do some cleanup when OpenVPN is disabled/deleted
if 'deleted' in openvpn or 'disable' in openvpn:
+ call(f'systemctl stop openvpn@{interface}.service')
for cleanup_file in glob(f'/run/openvpn/{interface}.*'):
if os.path.isfile(cleanup_file):
os.unlink(cleanup_file)
@@ -649,7 +649,7 @@ def apply(openvpn):
# No matching OpenVPN process running - maybe it got killed or none
# existed - nevertheless, spawn new OpenVPN process
- call(f'systemctl start openvpn@{interface}.service')
+ call(f'systemctl reload-or-restart openvpn@{interface}.service')
o = VTunIf(**openvpn)
o.update(openvpn)