summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2023-12-22 16:08:18 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2023-12-22 16:08:18 +0000
commitf999a7160745668dbcfd79a3c71bb8510d1aaabe (patch)
treec0d7805976bc9a1730ac2da22231a19c21ed0048
parentdfbc854157fa4655a8f459b2447df64dc74119d1 (diff)
downloadvyos-1x-f999a7160745668dbcfd79a3c71bb8510d1aaabe.tar.gz
vyos-1x-f999a7160745668dbcfd79a3c71bb8510d1aaabe.zip
T5840: Add override for systemd kea-ctrl-agent.service
After update KEA to 2.4.x in the bf04cd8fea44d375fb7d93d75a1f31c220730c88 there is a file that expects ConditionFileNotEmpty=/etc/kea/kea-api-password It cause the unit `kea-ctrl-agent.service` cannot start systemd[1]: kea-ctrl-agent.service - Kea Control Agent was skipped because of an unmet condition check (ConditionFileNotEmpty=/etc/kea/kea-api-password) Override systemd kea-ctrl-agent.service do not check this file
-rw-r--r--data/templates/dhcp-server/10-override.conf.j22
-rwxr-xr-xsrc/conf_mode/dhcp_server.py3
2 files changed, 5 insertions, 0 deletions
diff --git a/data/templates/dhcp-server/10-override.conf.j2 b/data/templates/dhcp-server/10-override.conf.j2
new file mode 100644
index 000000000..6cf9e0a11
--- /dev/null
+++ b/data/templates/dhcp-server/10-override.conf.j2
@@ -0,0 +1,2 @@
+[Unit]
+ConditionFileNotEmpty=
diff --git a/src/conf_mode/dhcp_server.py b/src/conf_mode/dhcp_server.py
index 958e90014..e06a3c8a8 100755
--- a/src/conf_mode/dhcp_server.py
+++ b/src/conf_mode/dhcp_server.py
@@ -41,6 +41,7 @@ ctrl_config_file = '/run/kea/kea-ctrl-agent.conf'
ctrl_socket = '/run/kea/dhcp4-ctrl-socket'
config_file = '/run/kea/kea-dhcp4.conf'
lease_file = '/config/dhcp4.leases'
+systemd_override = r'/run/systemd/system/kea-ctrl-agent.service.d/10-override.conf'
ca_cert_file = '/run/kea/kea-failover-ca.pem'
cert_file = '/run/kea/kea-failover.pem'
@@ -332,6 +333,8 @@ def generate(dhcp):
dhcp['failover']['ca_cert_file'] = ca_cert_file
+ render(systemd_override, 'dhcp-server/10-override.conf.j2', dhcp)
+
render(ctrl_config_file, 'dhcp-server/kea-ctrl-agent.conf.j2', dhcp)
render(config_file, 'dhcp-server/kea-dhcp4.conf.j2', dhcp)