Skip to content

Commit 9952d21

Browse files
authored
Merge pull request #4743 from sarthurdev/kea3.0
kea: T7281: Fix Kea 3.0 service failures
2 parents 5bb7816 + 868e45f commit 9952d21

File tree

22 files changed

+69
-56
lines changed

22 files changed

+69
-56
lines changed

data/templates/dhcp-server/kea-dhcp-ddns.conf.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"control-socket": {
66
{% if vrf_context is vyos_defined %}
77
"socket-type": "unix",
8-
"socket-name": "/run/kea/kea-ddns-{{ vrf_context }}-ctrl-socket"
8+
"socket-name": "/var/run/kea/kea-ddns-{{ vrf_context }}-ctrl-socket"
99
{% else %}
1010
"socket-type": "unix",
11-
"socket-name": "/run/kea/kea-ddns-ctrl-socket"
11+
"socket-name": "/var/run/kea/kea-ddns-ctrl-socket"
1212
{% endif %}
1313
},
1414
"tsig-keys": {{ dynamic_dns_update | kea_dynamic_dns_update_tsig_key_json }},

data/templates/dhcp-server/kea-dhcp4.conf.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
"control-socket": {
1818
{% if vrf_context is vyos_defined %}
1919
"socket-type": "unix",
20-
"socket-name": "/run/kea/dhcp4-{{ vrf_context }}-ctrl-socket"
20+
"socket-name": "/var/run/kea/dhcp4-{{ vrf_context }}-ctrl-socket"
2121
{% else %}
2222
"socket-type": "unix",
23-
"socket-name": "/run/kea/dhcp4-ctrl-socket"
23+
"socket-name": "/var/run/kea/dhcp4-ctrl-socket"
2424
{% endif %}
2525
},
2626
"lease-database": {

data/templates/dhcp-server/kea-dhcp6.conf.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
"control-socket": {
1313
{% if vrf_context is vyos_defined %}
1414
"socket-type": "unix",
15-
"socket-name": "/run/kea/dhcp6-{{ vrf_context }}-ctrl-socket"
15+
"socket-name": "/var/run/kea/dhcp6-{{ vrf_context }}-ctrl-socket"
1616
{% else %}
1717
"socket-type": "unix",
18-
"socket-name": "/run/kea/dhcp6-ctrl-socket"
18+
"socket-name": "/var/run/kea/dhcp6-ctrl-socket"
1919
{% endif %}
2020
},
2121
"lease-database": {

op-mode-definitions/monitor-log.xml.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@
4444
<properties>
4545
<help>Monitor last lines of DHCP server log</help>
4646
</properties>
47-
<command>journalctl --no-hostname --follow --boot --unit kea-dhcp4.service</command>
47+
<command>journalctl --no-hostname --follow --boot --unit isc-kea-dhcp4-server.service</command>
4848
<children>
4949
<tagNode name="vrf">
5050
<properties>
5151
<help>Monitor last lines of DHCP server log on specific vrf</help>
5252
</properties>
53-
<command>journalctl --no-hostname --follow --boot --unit "kea-dhcp4@$6.service"</command>
53+
<command>journalctl --no-hostname --follow --boot --unit "isc-kea-dhcp4-server@$6.service"</command>
5454
</tagNode>
5555
</children>
5656
</node>
@@ -82,13 +82,13 @@
8282
<properties>
8383
<help>Monitor last lines of DHCPv6 server log</help>
8484
</properties>
85-
<command>journalctl --no-hostname --follow --boot --unit kea-dhcp6.service</command>
85+
<command>journalctl --no-hostname --follow --boot --unit isc-kea-dhcp6-server.service</command>
8686
<children>
8787
<tagNode name="vrf">
8888
<properties>
8989
<help>Monitor last lines of DHCPv6 server log on specific vrf</help>
9090
</properties>
91-
<command>journalctl --no-hostname --follow --boot --unit "kea-dhcp6@$6.service"</command>
91+
<command>journalctl --no-hostname --follow --boot --unit "isc-kea-dhcp6-server@$6.service"</command>
9292
</tagNode>
9393
</children>
9494
</node>

op-mode-definitions/show-log.xml.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@
104104
<properties>
105105
<help>Show log for DHCP server</help>
106106
</properties>
107-
<command>journalctl --no-hostname --boot --unit kea-dhcp4.service</command>
107+
<command>journalctl --no-hostname --boot --unit isc-kea-dhcp4-server.service</command>
108108
<children>
109109
<tagNode name="vrf">
110110
<properties>
111111
<help>Monitor last lines of DHCP server log on specific vrf</help>
112112
</properties>
113-
<command>journalctl --no-hostname --follow --boot --unit "kea-dhcp4@$6.service"</command>
113+
<command>journalctl --no-hostname --follow --boot --unit "isc-kea-dhcp4-server@$6.service"</command>
114114
</tagNode>
115115
</children>
116116
</node>
@@ -142,13 +142,13 @@
142142
<properties>
143143
<help>Show log for DHCPv6 server</help>
144144
</properties>
145-
<command>journalctl --no-hostname --boot --unit kea-dhcp6.service</command>
145+
<command>journalctl --no-hostname --boot --unit isc-kea-dhcp6-server.service</command>
146146
<children>
147147
<tagNode name="vrf">
148148
<properties>
149149
<help>Monitor last lines of DHCPv6 server log on specific vrf</help>
150150
</properties>
151-
<command>journalctl --no-hostname --boot --unit "kea-dhcp6@$6.service"</command>
151+
<command>journalctl --no-hostname --boot --unit "isc-kea-dhcp6-server@$6.service"</command>
152152
</tagNode>
153153
</children>
154154
</node>

python/vyos/kea.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
'capwap_controller': 'capwap-ac-v6',
6161
}
6262

63-
kea_ctrl_socket = '/run/kea/dhcp{inet}{vrf_append}-ctrl-socket'
63+
kea_ctrl_socket = '/var/run/kea/dhcp{inet}{vrf_append}-ctrl-socket'
6464

6565

6666
def _format_hex_string(in_str):

smoketest/scripts/cli/test_service_dhcp-server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333

3434
PROCESS_NAME = 'kea-dhcp4'
3535
D2_PROCESS_NAME = 'kea-dhcp-ddns'
36-
KEA4_CONF = '/run/kea/kea-dhcp4.conf'
37-
KEA4_D2_CONF = '/run/kea/kea-dhcp-ddns.conf'
38-
KEA4_CTRL = '/run/kea/dhcp4-ctrl-socket'
36+
KEA4_CONF = '/var/run/kea/kea-dhcp4.conf'
37+
KEA4_D2_CONF = '/var/run/kea/kea-dhcp-ddns.conf'
38+
KEA4_CTRL = '/var/run/kea/dhcp4-ctrl-socket'
3939
HOSTSD_CLIENT = '/usr/bin/vyos-hostsd-client'
4040
base_path = ['service', 'dhcp-server']
4141
interface = 'dum8765'

smoketest/scripts/cli/test_service_dhcpv6-server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from vyos.utils.file import read_file
2727

2828
PROCESS_NAME = 'kea-dhcp6'
29-
KEA6_CONF = '/run/kea/kea-dhcp6.conf'
29+
KEA6_CONF = '/var/run/kea/kea-dhcp6.conf'
3030
base_path = ['service', 'dhcpv6-server']
3131

3232
subnet = '2001:db8:f00::/64'

smoketest/scripts/cli/test_vrf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ def test_dhcp_single_pool(self):
652652

653653
# declare fiels
654654
process_name = 'kea-dhcp4'
655-
kea4_conf = f'/run/kea/kea-{vrf}-dhcp4.conf'
655+
kea4_conf = f'/var/run/kea/kea-{vrf}-dhcp4.conf'
656656

657657
# create interface
658658
cidr_mask = subnet.split('/')[-1]
@@ -791,7 +791,7 @@ def test_dhcpv6_single_pool(self):
791791

792792
# declare fiels
793793
process_name = 'kea-dhcp6'
794-
kea6_conf = f'/run/kea/kea-{vrf}-dhcp6.conf'
794+
kea6_conf = f'/var/run/kea/kea-{vrf}-dhcp6.conf'
795795

796796
# create interface
797797
self.cli_set(['interfaces', 'dummy', interface, 'address', f'{interface_addr}'])

src/conf_mode/service_dhcp-server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,9 +582,9 @@ def apply(dhcp):
582582
# if running in vrf, set base diffrently
583583
if argv and len(argv) > 1:
584584
vrf_name = argv[1]
585-
services = [f'kea-dhcp4@{vrf_name}', f'kea-dhcp-ddns@{vrf_name}']
585+
services = [f'isc-kea-dhcp4-server@{vrf_name}', f'isc-kea-dhcp-ddns-server@{vrf_name}']
586586
else:
587-
services = ['kea-dhcp4', 'kea-dhcp-ddns']
587+
services = ['isc-kea-dhcp4-server', 'isc-kea-dhcp-ddns-server']
588588

589589
if not dhcp or 'disable' in dhcp:
590590
for service in services:
@@ -598,7 +598,7 @@ def apply(dhcp):
598598
for service in services:
599599
action = 'restart'
600600

601-
if 'kea-dhcp-ddns-server' in service and 'dynamic_dns_update' not in dhcp:
601+
if 'isc-kea-dhcp-ddns-server' in service and 'dynamic_dns_update' not in dhcp:
602602
action = 'stop'
603603

604604
call(f'systemctl {action} {service}.service')

0 commit comments

Comments
 (0)