summaryrefslogtreecommitdiff
path: root/src/conf_mode/dns_dynamic.py
diff options
context:
space:
mode:
authorIndrajit Raychaudhuri <irc@indrajit.com>2023-06-09 18:31:25 -0500
committerIndrajit Raychaudhuri <irc@indrajit.com>2023-06-09 21:02:22 -0500
commit316b0e3912feccb27baa1fab79efdb41b2546069 (patch)
tree2d2d5cdb99fc54693ce38b5913efb55affacdfc9 /src/conf_mode/dns_dynamic.py
parent3c7c3b6cb08ffb5e177b10594281af8153c7e29c (diff)
downloadvyos-1x-316b0e3912feccb27baa1fab79efdb41b2546069.tar.gz
vyos-1x-316b0e3912feccb27baa1fab79efdb41b2546069.zip
dns: T5144: Force systemd daemon-reload on ddclient config change
Diffstat (limited to 'src/conf_mode/dns_dynamic.py')
-rwxr-xr-xsrc/conf_mode/dns_dynamic.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/conf_mode/dns_dynamic.py b/src/conf_mode/dns_dynamic.py
index e070a3502..67134e681 100755
--- a/src/conf_mode/dns_dynamic.py
+++ b/src/conf_mode/dns_dynamic.py
@@ -117,13 +117,17 @@ def generate(dyndns):
return None
def apply(dyndns):
+ systemd_service = 'ddclient.service'
+ # Reload systemd manager configuration
+ call('systemctl daemon-reload')
+
# bail out early - looks like removal from running config
if not dyndns or 'address' not in dyndns:
- call('systemctl stop ddclient.service')
+ call(f'systemctl stop {systemd_service}')
if os.path.exists(config_file):
os.unlink(config_file)
else:
- call('systemctl restart ddclient.service')
+ call(f'systemctl reload-or-restart {systemd_service}')
return None