Adjust documentation to /run instead of /var/run
After setting up and installing kea with ha my server wasn't starting anymore. I got following error:
ERROR [kea-dhcp4.dhcp4.128051035642304] DHCP4_PARSER_COMMIT_FAIL parser failed to commit changes: cannot create socket lockfile, /var/run/kea/socket-v4.lock, : Permission denied
ERROR [kea-dhcp4.dhcp4.128051035642304] DHCP4_CONFIG_LOAD_FAIL configuration error using file: /etc/kea/kea-dhcp4.conf, reason: cannot create socket lockfile, /var/run/kea/socket-v4.lock, : Permission denied
2024-05-03 20:23:32.822 ERROR [kea-dhcp4.dhcp4/2239.128051035642304] DHCP4_INIT_FAIL failed to initialize Kea server: configuration error using file '/etc/kea/kea-dhcp4.conf': cannot create socket lockfile, /var/run/kea/socket-v4.lock, : Permission denied
ERROR [kea-dhcp4.dhcp4.128051035642304] DHCP4_INIT_FAIL failed to initialize Kea server: configuration error using file '/etc/kea/kea-dhcp4.conf': cannot create socket lockfile, /var/run/kea/socket-v4.lock, : Permission denied
I followed your documentation which uses /var/run/kea/control-socket
for the socket.
In the end apparmor and the usage of /var/run/kea/socket-v4
was the issue. In the profile, which is automatically added during installation, kea is only allowed to access and modify /run/kea/kea4-ctrl-socket
.
Snippet from apparmor profile:
# Control sockets
# Before LP: #1863100, these were in /tmp. For compatibility, let's keep both
# locations
owner /{tmp,run/kea}/kea4-ctrl-socket w,
owner /{tmp,run/kea}/kea4-ctrl-socket.lock rwk,
Please adjust the documentation accordingly.
Edited by Philipp Bender