Back in January there was a thread[1] to fix uncontrolled growth of
dhcpd.leases in /var/db.

[1] https://marc.info/?l=openbsd-ports&m=170485567714523&w=2

The proposed fix to use /var/db/isc-dhcp as a base for the leases
db was used.  It looks like the port Makefile patched to use
/var/db/isc-dhcp just fine, but the pkg/PLIST-main file creates
/var/db/isc-dhcpd.

I was hit by this doing some rather late upgrades from 7.4->7.5
and discovered the path it was looking for from the error messages:

Can't open lease database /var/db/isc-dhcp/dhcpd.leases: No such file or 
directory --
  check for failed database rewrite attempt!

Makefile:
CONFIGURE_ARGS+=        --enable-early-chroot \
                        --enable-paranoia \
                        --with-srv-lease-file=/var/db/isc-dhcp/dhcpd.leases \
                        --with-srv6-lease-file=/var/db/isc-dhcp/dhcpd6.leases

pkg/PLIST-main:
@sample /var/db/isc-dhcpd/
@mode
@owner
@group
@extra /var/db/isc-dhcpd/dhcpd.leases
@extra /var/db/isc-dhcpd/dhcpd6.leases

This patch should be all that is needed, builds/packages/installs fine with
matching directories.



Index: Makefile
===================================================================
RCS file: /cvs/ports/net/isc-dhcp/Makefile,v
diff -u -p -r1.67 Makefile
--- Makefile    3 Mar 2024 18:15:42 -0000       1.67
+++ Makefile    9 Sep 2024 20:47:03 -0000
@@ -3,7 +3,7 @@ COMMENT-client= ISC DHCP Client
 COMMENT-omapi= ISC DHCP OMAPI
 
 VERSION=       4.4.3-P1
-REVISION=      1
+REVISION=      2
 
 DISTNAME=      isc-dhcp-${VERSION}
 PKGNAME-main=  isc-dhcp-server-${VERSION:S/-P/pl/}
Index: pkg/PLIST-main
===================================================================
RCS file: /cvs/ports/net/isc-dhcp/pkg/PLIST-main,v
diff -u -p -r1.9 PLIST-main
--- pkg/PLIST-main      3 Mar 2024 18:15:42 -0000       1.9
+++ pkg/PLIST-main      9 Sep 2024 20:47:03 -0000
@@ -20,9 +20,9 @@ share/examples/isc-dhcp/dhcpd.conf
 @mode 755
 @owner _isc-dhcp
 @group _isc-dhcp
-@sample /var/db/isc-dhcpd/
+@sample /var/db/isc-dhcp/
 @mode
 @owner
 @group
-@extra /var/db/isc-dhcpd/dhcpd.leases
-@extra /var/db/isc-dhcpd/dhcpd6.leases
+@extra /var/db/isc-dhcp/dhcpd.leases
+@extra /var/db/isc-dhcp/dhcpd6.leases

Reply via email to