Skip to content

Commit

Permalink
Merge pull request #4276 from indrajitr/ddclient-process-2025-01-04
Browse files Browse the repository at this point in the history
ddclient: T5791: Keep ddclient.service in foreground
  • Loading branch information
dmbaturin authored Jan 6, 2025
2 parents 5ae3f05 + dbf42ed commit 53cb3e5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
1 change: 0 additions & 1 deletion data/templates/dns-dynamic/ddclient.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ if{{ ipv }}={{ address }}, \
daemon={{ interval }}
syslog=yes
ssl=yes
pid={{ config_file | replace('.conf', '.pid') }}
cache={{ config_file | replace('.conf', '.cache') }}
{# ddclient default (web=dyndns) doesn't support ssl and results in process lockup #}
web=googledomains
Expand Down
5 changes: 3 additions & 2 deletions data/templates/dns-dynamic/override.conf.j2
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{% set vrf_command = 'ip vrf exec ' ~ vrf ~ ' ' if vrf is vyos_defined else '' %}
[Unit]
ConditionPathExists={{ config_file }}
Wants=
After=vyos-router.service

[Service]
PIDFile={{ config_file | replace('.conf', '.pid') }}
EnvironmentFile=
ExecStart=
ExecStart={{ vrf_command }}/usr/bin/ddclient -file {{ config_file }}
ExecStart={{ vrf_command }}/usr/bin/ddclient --file {{ config_file }} --foreground
Restart=always
16 changes: 10 additions & 6 deletions smoketest/scripts/cli/test_service_dns_dynamic.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (C) 2019-2024 VyOS maintainers and contributors
# Copyright (C) 2019-2025 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
Expand Down Expand Up @@ -38,9 +38,13 @@
interface = 'eth0'

class TestServiceDDNS(VyOSUnitTestSHIM.TestCase):
def setUp(self):
# Always start with a clean CLI instance
self.cli_delete(base_path)
@classmethod
def setUpClass(cls):
super(TestServiceDDNS, cls).setUpClass()

# ensure we can also run this test on a live system - so lets clean
# out the current configuration :)
cls.cli_delete(cls, base_path)

def tearDown(self):
# Check for running process
Expand Down Expand Up @@ -336,8 +340,8 @@ def test_08_dyndns_vrf(self):

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

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

0 comments on commit 53cb3e5

Please sign in to comment.