[Dnsmasq-discuss] [PATCH] Logging of dhcp_script output

Petr Menšík pemensik at redhat.com
Tue May 9 18:49:56 BST 2017


Hi Simon,

sorry for a delay. We concluded that we do not like die on parse error
even for dhcp script. It does always start up now unless script returns
nonzero exit status. With this change, it would never start, until you
were able to figure out what is wrong with your script. Then fix the
cause. Until that, no-one will receive any lease as they did before.

When assigning addresses to dhclient that had his address before,
dnsmasq will offer requested address if it is not leased. If you start
with clear leases, many machines will receive correct addresses again.
Dnsmasq is used as small server for containers or virtual hosts on the
local machine. I think it is quite useful they will always (try to) start.

I think it should be possible to disable dying on parse errors. I think
change from totally ignoring parsing errors to being not able to skip
them is problematic for real world administrators.

I would prefer current behavior as default, but with possible
configuration override. I think it would be useful if return code
suggested there is problem with lease database. I could then move old
leases file and retry with empty database from the startup script.

What do you think?

Dne 29.4.2017 v 00:03 Simon Kelley napsal(a):
> On 24/04/17 15:42, Petr Mensik wrote:
>> Thank you for accepting that patches. I agree that some garbage is
>> far more likely to appear in dhcp-script mode. I would myself welcome
>> error log from wrong formatted lease file as well. If I understand it
>> well, that file will be overwritten after the first lease created. If
>> it contains wrong data, just log an error, but do not terminate.
> 
> That seems sensible. Change committed.
>>
>> It should not surprise administrator that just disabled IPv6 support.
>> Error message would be logged once at startup until the first lease
>> is created. Then file will be rewritten without any IPv6 leases,
>> because they were skipped during the reading. I would accept one
>> error message as notification some leases are gone forever.
>>
> Agreed.
> 
>> I will have to ask whether failure to start on database corruption is
>> considered a problem. It was silently ignoring all problems before.
>> Now it fails to start the service completely if any error occurs. I
>> think it relied on auto recovery with empty leases in the same way as
>> with plain file. I think there should be a way to override default
>> behavior. I will check for more opinions and get back with results.
>>
> 
> Any news on this?
> 
> 
> Cheers,
> 
> Simon.
> 
>> Thank you Simon.
>>
>> Cheers, Petr
>>
>>
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20170509/4780fa9a/attachment.sig>


More information about the Dnsmasq-discuss mailing list