Skip to content

Commit 53cb3e5

Browse files
authored
Merge pull request #4276 from indrajitr/ddclient-process-2025-01-04
ddclient: T5791: Keep ddclient.service in foreground
2 parents 5ae3f05 + dbf42ed commit 53cb3e5

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

data/templates/dns-dynamic/ddclient.conf.j2

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ if{{ ipv }}={{ address }}, \
2424
daemon={{ interval }}
2525
syslog=yes
2626
ssl=yes
27-
pid={{ config_file | replace('.conf', '.pid') }}
2827
cache={{ config_file | replace('.conf', '.cache') }}
2928
{# ddclient default (web=dyndns) doesn't support ssl and results in process lockup #}
3029
web=googledomains
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{% set vrf_command = 'ip vrf exec ' ~ vrf ~ ' ' if vrf is vyos_defined else '' %}
22
[Unit]
33
ConditionPathExists={{ config_file }}
4+
Wants=
45
After=vyos-router.service
56

67
[Service]
7-
PIDFile={{ config_file | replace('.conf', '.pid') }}
88
EnvironmentFile=
99
ExecStart=
10-
ExecStart={{ vrf_command }}/usr/bin/ddclient -file {{ config_file }}
10+
ExecStart={{ vrf_command }}/usr/bin/ddclient --file {{ config_file }} --foreground
11+
Restart=always

smoketest/scripts/cli/test_service_dns_dynamic.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22
#
3-
# Copyright (C) 2019-2024 VyOS maintainers and contributors
3+
# Copyright (C) 2019-2025 VyOS maintainers and contributors
44
#
55
# This program is free software; you can redistribute it and/or modify
66
# it under the terms of the GNU General Public License version 2 or later as
@@ -38,9 +38,13 @@
3838
interface = 'eth0'
3939

4040
class TestServiceDDNS(VyOSUnitTestSHIM.TestCase):
41-
def setUp(self):
42-
# Always start with a clean CLI instance
43-
self.cli_delete(base_path)
41+
@classmethod
42+
def setUpClass(cls):
43+
super(TestServiceDDNS, cls).setUpClass()
44+
45+
# ensure we can also run this test on a live system - so lets clean
46+
# out the current configuration :)
47+
cls.cli_delete(cls, base_path)
4448

4549
def tearDown(self):
4650
# Check for running process
@@ -336,8 +340,8 @@ def test_08_dyndns_vrf(self):
336340

337341
# Check for process in VRF
338342
systemd_override = cmd(f'cat {DDCLIENT_SYSTEMD_UNIT}')
339-
self.assertIn(f'ExecStart=ip vrf exec {vrf_name} /usr/bin/ddclient -file {DDCLIENT_CONF}',
340-
systemd_override)
343+
self.assertIn(f'ExecStart=ip vrf exec {vrf_name} /usr/bin/ddclient ' \
344+
f'--file {DDCLIENT_CONF} --foreground', systemd_override)
341345

342346
# Check for process in VRF
343347
proc = cmd(f'ip vrf pids {vrf_name}')

0 commit comments

Comments
 (0)