[Dnsmasq-discuss] feature: dictionary order import of addn-hosts dirs?

Simon Kelley simon at thekelleys.org.uk
Wed Aug 18 13:44:49 UTC 2021



On 17/08/2021 19:24, john doe wrote:
> On 8/14/2021 7:00 PM, Simon Kelley wrote:
>>
>>
>> On 12/08/2021 18:30, john doe wrote:
>>> On 8/12/2021 5:04 PM, Simon Kelley wrote:
>>>> On 11/08/2021 00:25, Ed W wrote:
>>>>> On 10/08/2021 23:12, Simon Kelley wrote:
>>>>>> On 08/08/2021 14:02, Ed W wrote:
>>>>>>> On 19/07/2021 18:52, Ed W wrote:
>>>
>>> [snip]
>>>
>>>> --dhcp-hostsdir --dhcp-optsdir and --hostsdir work in much the same way
>>>> as when the first three options are given a directory; the files are
>>>> read at start-up and when SIGHUP is received. BUT any file which is
>>>> modified or created gets read asynchronously, without needing SIGHUP to
>>>> be sent. Note that the old data from the files is not discarded when
>>>> this is done: if a file gets modified, then it gets re-read but data
>>>> from the previous version of the file is not deleted. This means that
>>>
>>> Why is deleting not happening when the file is reread?
>>>
>>>> this facility is useful for adding hosts to the configuration without
>>>> the upheaval of a full SIGHUP re-read. Anytime you want to delete
>>>> stuff,
>>>> SIGHUP is still needed.
>>>>
>>>
>>> In other words, what is the reasoning behind requiring SIGHUP to delete
>>> stuff?
>>>
>>
>> The cache datastructures don't allow track where names came from, so the
>> choices are to clear the cache and re-read all configuration files, or
>> not to delete anything.
>>
> 
> Thank you, that would explain the following:
> 
> inotify, new or changed file /etc/dnsmasq-dhcp-hosts.d/try
> read /etc/dnsmasq-dhcp-hosts.d/try
> duplicate dhcp-host IP address 172.17.232.10 at line 7 of
> /etc/dnsmasq-dhcp-hosts.d/try
> duplicate dhcp-host IP address 172.17.232.11 at line 9 of
> /etc/dnsmasq-dhcp-hosts.d/try
> 
> 
> Is there a way to disable inotify?

Use dhcp-hostsfile=</path/to/directory>instead of
dhcp-hostsdir=</path/to/directory>

dhcp-hostsfil is fine with a directory argument, and doesn't implement
the automatic re-read function.


Simon.

> 
> P.S.
> 
> When 'duplicate' messages are razed would it be possible to have a hint
> that SIGHUP should be used?
> 

Possibly, but there are lost of reasons why that message might be seen
that are nothing to do with inotify versus SIGHUP.


Simon.

> -- 
> John Doe
> 
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss
> 



More information about the Dnsmasq-discuss mailing list