From 316b0e3912feccb27baa1fab79efdb41b2546069 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Fri, 9 Jun 2023 18:31:25 -0500 Subject: dns: T5144: Force systemd daemon-reload on ddclient config change --- src/conf_mode/dns_dynamic.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/conf_mode/dns_dynamic.py') 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 -- cgit v1.2.3