summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-11-15 21:19:51 +0100
committerChristian Poessinger <christian@poessinger.com>2021-11-17 20:41:25 +0100
commitb618790b9e5ab51e5d4f65e6756fedca70882cba (patch)
tree52dc270d4017ac9a4eabd0a7f73e711e580f944f /src/conf_mode
parent50a1b4a1170182864760613216b68322f165a749 (diff)
downloadvyos-1x-b618790b9e5ab51e5d4f65e6756fedca70882cba.tar.gz
vyos-1x-b618790b9e5ab51e5d4f65e6756fedca70882cba.zip
openvpn: T3995: implement systemd reload support
(cherry picked from commit eceaa3a787929f5a514b9c45da52936c0d4d4a54)
Diffstat (limited to 'src/conf_mode')
-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 4e3c19be2..ae35ed3c4 100755
--- a/src/conf_mode/interfaces-openvpn.py
+++ b/src/conf_mode/interfaces-openvpn.py
@@ -493,10 +493,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)
@@ -508,7 +508,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')
conf = VTunIf.get_config()
conf['device_type'] = openvpn['device_type']