Kea leases not getting backed up with RAM disks enabled on 2.9.0
-
So I enabled RAM disks on my 2.9.0 box and on the first reboot it lost all my Kea DHCP leases, which caused a bunch of IP conflicts.
I dug into it and it looks like /etc/rc.backup_dhcpleases.sh still backs up /var/lib/kea, but Kea writes its leases to /var/db/kea now. So the backup never grabs the real lease files. In my case it was saving old stale files from /var/lib/kea that were left over from before the upgrade.
I checked it by running the backup script and listing the archive with tar tzvf /cf/conf/RAM_Disk_Store/dhcpleases.tgz. There were no var/db/kea entries, just the old dhcpd stuff.
I made a custom patch in System Patches that changes the Kea folder in that script from /var/lib/kea to /var/db/kea. After that the archive has the current dhcp4.leases files, and extracting it to a temp folder matches the live ones exactly.
Testing this with an actual reboot was successful. My current leases were not lost and they were all restored successfully. I also rebooted once without the patch to compare, and that lost all the leases even though the restore log said it succeeded.
Here is the patch I am using to fix the issue:
Setting - Path Strip Count: 1
--- a/etc/rc.backup_dhcpleases.sh +++ b/etc/rc.backup_dhcpleases.sh @@ -21,7 +21,7 @@ BACKUPTABLE=" # PATH PATTERN RECURSE DESCRIPTION /var/dhcpd/var/db * N DHCPD leases - /var/lib/kea * N Kea leases + /var/db/kea * N Kea leases " : ${CF_CONF_PATH:="/cf/conf"}Is anyone else seeing this? Just want to confirm before I open a redmine ticket.
-
@Jager I'd say you are right and it's the same issue on latest 26.07+. I got both directories but only the
dbdirectory got recent lease files. Not sure if Netgate compiled Kea with a different var directory on purpose or if it's an oversight.[26.07-RELEASE][root@pfp.home.arpa]/root: ls -l /var/{lib,db}/kea/ /var/db/kea/: total 19 -rw-r----- 1 root wheel 302 Oct 25 21:45 dhcp4.leases -rw-r----- 1 root wheel 457 Oct 25 21:37 dhcp4.leases.2 -rw-r----- 1 root wheel 168 Oct 25 21:37 dhcp6.leases -rw-r----- 1 root wheel 454 Oct 25 21:37 dhcp6.leases.2 -rw-r--r-- 1 root wheel 41 Oct 25 16:37 kea-dhcp6-serverid /var/lib/kea/: total 18 -rw-r--r-- 1 root wheel 3271 Dec 10 2025 dhcp4.leases -rw-r--r-- 1 root wheel 453 Sep 25 2025 dhcp4.leases.2 -rw-r--r-- 1 root wheel 5291 Dec 10 2025 dhcp6.leases -rw-r--r-- 1 root wheel 674 Sep 25 2025 dhcp6.leases.2
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginPrivacy Policy · Cookie Policy