> On 10. Jan 2024, at 21:21, Stuart Henderson <s...@spacehopper.org> wrote: > > On 2024/01/10 18:49, Kirill A. Korinsky wrote: > >> or add readme / note which suggest to move that file by hand >> before services is started with wording like this: >> >> The previous version of ISC-DHCPD contained a bug that caused missed >> permissions >> when writing to the leases DB. This resulted in the database being stored at >> /var/db/dhcpd.leases~ instead of /var/db/dhcpd.leases and never updated or >> cleanedup. Please move an actual DB into /var/db/dhcpd/dhcpd.leases with >> changing ownership to _isc-dhcp:_isc-dhcp. You may use dhcp-lease-list to >> determine which DB is actual one. > > hrmmm, that doesn't make sense, if it can't write to /var/db/dhcpd.leases > due to permissions, it shouldn't be able to write to /var/db/dhcpd.leases~ > either.. > > I'll try and find some time to do a test install and figure out what's > going on, but it won't be for a few days
To speed things I've dig how dhcpd works. The first thing that dhcpd.leases~ is backup of dhcpd.leases. Also, it seems that the service opens files before drop users, that explains why it works. Also, without empty dhcpd.leases it won't start => touch here. Next my issue. The issue isn't permission on that files. The issue is permission on folder where it keeps files. See: https://github.com/isc-projects/dhcp/blob/v4_4_3/server/db.c#L1133 <https://github.com/isc-projects/dhcp/blob/v4_4_3/server/db.c#L1133> Long story short: It creates temp files and fill it, after renames it. Without permission to write to the folder it can't cleanup DB, and it continue to grow. This is why I need a dedicated folder. And if we move with migration option, what should be done for downgrade? -- wbr, Kirill