[LEDE-DEV] [PATCH] dnsmasq: write atomic config file

Kevin Darbyshire-Bryant kevin at darbyshire-bryant.me.uk
Mon Jun 13 07:20:24 PDT 2016



On 13/06/16 14:50, Felix Fietkau wrote:
> On 2016-06-13 15:40, Jo-Philipp Wich wrote:
>> Hi Ulrich,
>>
>> wouldn't some protection with "flock" or similar be better in this case
>> in order to serialize config generation and restart tasks?
> I don't think we should be using flock. We should find a way to have
> procd serialize init script calls properly.
>
> As far as I know, dnsmasq can also re-read its configuration file, so
> regardless of the issue of locking init scripts against concurrent
> calls, this change is useful.
dnsmasq never re-reads the config file.  It may re-read: 
/etc/resolv.conf, dhcp-hostsfile, dhcp-optsfile, dhcp-hostsdir, 
/etc/ethers, --servers-file, usually in response to SIGHUP though 
/etc/resolv.conf may be polled.   From the manpage:

"When it receives a SIGHUP, *dnsmasq * clears its cache and then 
re-loads //etc/hosts/ and //etc/ethers / and any file given by 
--dhcp-hostsfile, --dhcp-hostsdir, --dhcp-optsfile, --dhcp-optsdir, 
--addn-hosts or --hostsdir. The dhcp lease change script is called for 
all existing DHCP leases. If *--no-poll* is set SIGHUP also re-reads 
//etc/resolv.conf./ SIGHUP does NOT re-read the configuration file."

Kevin

>
> - Felix
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev




More information about the Lede-dev mailing list