<html><body><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; direction: null; color: #000000;" data-attr="forced_root_block_attrs">
<div>Hi,</div>
<div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; color: #000000;" data-attr="forced_root_block_attrs"> </div>
<div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; color: #000000;" data-attr="forced_root_block_attrs">some clarifications:</div>
<div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; color: #000000;" data-attr="forced_root_block_attrs">the -p command line parameter in lfc executable is referring to the pid file used for lease file operations, while the KEA_LOCKFILE_DIR is used for the lockfile used for logging.</div>
<div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; color: #000000;" data-attr="forced_root_block_attrs"> </div>
<div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; color: #000000;" data-attr="forced_root_block_attrs">I have tested your scenario and it seems to be working. I guess the problem on your side is that the exported environment variable is not inherited by the root environment when doing sudo -u ...</div>
<div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; color: #000000;" data-attr="forced_root_block_attrs"> </div>
<div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; color: #000000;" data-attr="forced_root_block_attrs">the easiest way to pass the environment variable is to add it just before the executable:</div>
<div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; color: #000000;" data-attr="forced_root_block_attrs"> </div>
<div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; color: #000000;" data-attr="forced_root_block_attrs">sudo -u ... KEA_LOCKFILE_DIR=/var/lib/kea-VRF039/ /usr/sbin/kea-lfc -4 ...</div>
<div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; color: #000000;" data-attr="forced_root_block_attrs"> </div>
<div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; color: #000000;" data-attr="forced_root_block_attrs">to achieve this using services, please consult the man for options regarding environment variables in the service file.</div>
<div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; color: #000000;" data-attr="forced_root_block_attrs"> </div>
<div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; color: #000000;" data-attr="forced_root_block_attrs">I hope this helps.</div>
<div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; color: #000000;" data-attr="forced_root_block_attrs"> </div>
<div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; color: #000000;" data-attr="forced_root_block_attrs">Razvan</div>
<div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; color: #000000;" data-attr="forced_root_block_attrs"> </div>
<div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; color: #000000;" data-attr="forced_root_block_attrs"> </div>
<div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; color: #000000;" data-attr="forced_root_block_attrs"> </div>
<div> </div>
<div id="signature-content-no-signature" data-marker="__SIG_PRE__"></div>
<div>

<div id="OLK_SRC_BODY_SECTION">
<div id="OLK_SRC_BODY_SECTION">
<blockquote style="margin: 0 0 0 .8em; border-left: 1px #ccc solid; padding-left: 1em;"><hr id="MESSAGE_DATA_MARKER"><strong>From: </strong>Darren <darren.ankney@gmail.com><br><strong>To: </strong>Kea <kea-users@lists.isc.org><br><strong>Date: </strong>Monday, 10 June 2024 10:01 PM EEST<br><strong>Subject: </strong>Re: [Kea-users] kea-lfc not using KEA_LOCKFILE_DIR<br><br>Hi Martijn,<br><br>Looking in the ARM, I only find KEA_LOCKFILE_DIR mentioned here:<br>https://kea.readthedocs.io/en/kea-2.4.1/arm/logging.html#logging-during-kea-startup<br>which pertains only to controlling destination of logging while Kea is<br>starting up (before it has read the configuration file completely).<br>These environment variables don't seem to have anything to do with<br>`kea-lfc`. Can you point to where you saw that `kea-lfc` should<br>respect these environment variables?<br><br>Thank you,<br>Darren Ankney<br><br>On Tue, Jun 4, 2024 at 10:43 AM Martijn via Kea-users<br><kea-users@lists.isc.org> wrote:<br>><br>> Hi,<br>><br>> We are currently implementing Kea for a multi tenant/VRF scenario. We do this by running multiple instances of kea-dhcp4 with a systemd unit template. Because we have multiple Kea instances running, we need separate folders for storing PIDs, lock files and configs. So far, this is working fine. The Kea service is running, establishing HA session and serving requests.<br>><br>> We just have a problem with the periodic lease file cleaning performed by kea-lfc, while the lease file cleanup seems to be successful. It is logging errors relating to using a lock file for the logger.<br>><br>> Jun 04 15:49:27 dhcp-01 kea-dhcp4-VRF039[1395]: INFO DHCPSRV_MEMFILE_LFC_START starting Lease File Cleanup<br>> Jun 04 15:49:27 dhcp-01 kea-dhcp4-VRF039[1395]: INFO DHCPSRV_MEMFILE_LFC_EXECUTE executing Lease File Cleanup using: /usr/sbin/kea-lfc -4 -x /var/lib/kea-VRF039/dhcp4.leases.2 -i /var/lib/kea-VRF039/dhcp4.leases.1 -o /var/lib/kea-VRF039/dhcp4.leases.output -f /var/lib/kea-VRF039/dhcp4.leases.completed -p /var/lib/kea-VRF039/dhcp4.leases.pid -c ignored-path<br>> Jun 04 15:49:28 dhcp-01 kea-dhcp4-VRF039[2571]: Unable to use interprocess sync lockfile (No such file or directory): /var/run/kea/logger_lockfile<br>> Jun 04 15:49:28 dhcp-01 kea-dhcp4-VRF039[2571]: Unable to use interprocess sync lockfile (No such file or directory): /var/run/kea/logger_lockfile<br>> ---- 6 more identical messages ----<br>><br>> I have tried manually running the process with the specified arguments from the log message and setting the KEA_LOCKFILE_DIR environment variable. However, kea-lfc still doesn’t seem to use the environment variable.<br>><br>> $ export KEA_LOCKFILE_DIR=/run/lock/kea-VRF039<br>> $ echo $KEA_LOCKFILE_DIR<br>> /run/lock/kea-VRF039<br>><br>> $ sudo -u _kea -g _kea \<br>> /usr/sbin/kea-lfc -4 \<br>> -x /var/lib/kea-VRF039/dhcp4.leases.2 \<br>> -i /var/lib/kea-VRF039/dhcp4.leases.1 \<br>> -o /var/lib/kea-VRF039/dhcp4.leases.output \<br>> -f /var/lib/kea-VRF039/dhcp4.leases.completed \<br>> -p /var/lib/kea-VRF039/dhcp4.leases.pid \<br>> -c ignored-path<br>><br>> Unable to use interprocess sync lockfile (No such file or directory): /var/run/kea/logger_lockfile<br>> Unable to use interprocess sync lockfile (No such file or directory): /var/run/kea/logger_lockfile<br>> Unable to use interprocess sync lockfile (No such file or directory): /var/run/kea/logger_lockfile<br>> Unable to use interprocess sync lockfile (No such file or directory): /var/run/kea/logger_lockfile<br>> Unable to use interprocess sync lockfile (No such file or directory): /var/run/kea/logger_lockfile<br>> Unable to use interprocess sync lockfile (No such file or directory): /var/run/kea/logger_lockfile<br>> Unable to use interprocess sync lockfile (No such file or directory): /var/run/kea/logger_lockfile<br>><br>><br>> I have read through the code and it seems like the environment variable should be used. So I am not sure what’s going wrong. I have found an issue on the nixpkgs GitHub which seems to describe the same issue (kea-lfc not using KEA_LOCKFILE_DIR) https://github.com/NixOS/nixpkgs/issues/265826<br>><br>> Is this a known issue or am I doing something wrong?<br>><br>> Some additional info:<br>> Distro: Ubuntu 24.04 LTS<br>> Using the package from ubuntu APT sources:<br>> Package: kea-dhcp4-server<br>> Version: 2.4.1-3build3<br>><br>><br>> Regards,<br>><br>> Martijn<br>> --<br>> ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.<br>><br>> To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.<br>><br>> Kea-users mailing list<br>> Kea-users@lists.isc.org<br>> https://lists.isc.org/mailman/listinfo/kea-users<br>-- <br>ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.<br><br>To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.<br><br>Kea-users mailing list<br>Kea-users@lists.isc.org<br>https://lists.isc.org/mailman/listinfo/kea-users</blockquote>
</div>
</div></div>
</div></body></html>