Skip to content

Preserve dnsmasq DHCP leases on mounted storage #1694

Description

@gsanchietti

Description

Persist dnsmasq DHCP leases across reboots when NethSecurity storage is configured on /mnt/data.

When storage is mounted, dnsmasq should use a persistent lease file under /mnt/data/dnsmasq/dhcp.leases.

When storage is not mounted, the system must keep using /tmp/dhcp.leases.

If storage is later unmounted or enters an error state, dnsmasq must switch back to /tmp/dhcp.leases before /mnt/data is removed.

The target directory must be created automatically before switching dnsmasq, otherwise the service will fail to start.

This preserves address continuity for clients across reboots, especially on systems with a small DHCP pool.

Alternative solutions

  • Keep using /tmp/dhcp.leases and periodically copy it to persistent storage. Rejected because dnsmasq would still restart from a volatile lease file after reboot.
  • Update every consumer to read the storage-backed lease file directly. Rejected because the change should stay inside ns-storage and keep existing /tmp/dhcp.leases consumers compatible.

References

  • Requested flow: keep /tmp when storage is absent, switch to storage when mounted, revert to /tmp before unmount.
  • Current config example: dhcp.ns_dnsmasq.leasefile='/tmp/dhcp.leases'

Metadata

Metadata

Assignees

No one assigned

    Labels

    verifiedAll test cases were verified successfully

    Fields

    No fields configured for Feature.

    Projects

    Status
    Verified

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions