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'
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.leasesbefore/mnt/datais 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
/tmp/dhcp.leasesand periodically copy it to persistent storage. Rejected because dnsmasq would still restart from a volatile lease file after reboot.ns-storageand keep existing/tmp/dhcp.leasesconsumers compatible.References
/tmpwhen storage is absent, switch to storage when mounted, revert to/tmpbefore unmount.dhcp.ns_dnsmasq.leasefile='/tmp/dhcp.leases'