Re: [Dnsmasq-discuss] dhcp-script not being called with "del"

2020-02-26 Thread Simon Kelley
On 23/02/2020 19:41, William Edwards wrote:
> Hi,
> 
> I have a 'dhcp-script'. It is being called with "add" and "old" upon
> requesting DHCP lease, but when a lease expires, it is not called with
> "del".
> 
> To test, I changed lease time to 1 minute and kept an eye on
> /var/lib/misc/dnsmasq.leases . After 1 minute, the lease disappeared
> from /var/lib/misc/dnsmasq.leases (thus expired). However, the
> 'dhcp-script' was not called.
> 
> How could I start researching this issue?
> 

For a start, be aware the dnsmasq enforces a minimum time of two minutes
on DHCP leases, so what you think is happening may not actually be
happening.



Making your script something like

#!/bin/bash
echo $* >>/tmp/logfile
env >>/tmp/logfile

is useful to see what's going on.

Simon.


___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] dhcp-script not being called with "del"

2020-02-23 Thread Geert Stappers
On Sun, Feb 23, 2020 at 09:57:20PM +0100, Geert Stappers wrote:
> On Sun, Feb 23, 2020 at 08:41:28PM +0100, William Edwards wrote:
> > 
> > Hi,
> > 
> > I have a 'dhcp-script'. It is being called with "add" and "old" upon
> > requesting DHCP lease, but when a lease expires,
> > it is not called with "del".
> > 
> > To test, I changed lease time to 1 minute and kept an eye on
> > /var/lib/misc/dnsmasq.leases . After 1 minute, the lease disappeared
> > from /var/lib/misc/dnsmasq.leases (thus expired).
> > However, the 'dhcp-script' was not called.
> > 
> > How could I start researching this issue?
> > 
> 
> Go see what dnsmasq can see from the client.
> 

I might be wrong that starting `dhcp-script` is only triggered
by DHCP-event from the DHCP-client.  Manual page says only
  "del" means it has been destroyed
It doesn't say what destroys a lease.  I was thinking "DHCP release",
but I'm not sure about it.  However: a network sniff never harms.


Regards
Geert Stappers
-- 
Silence is hard to parse

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] dhcp-script not being called with "del"

2020-02-23 Thread Geert Stappers
On Sun, Feb 23, 2020 at 08:41:28PM +0100, William Edwards wrote:
> 
> Hi,
> 
> I have a 'dhcp-script'. It is being called with "add" and "old" upon
> requesting DHCP lease, but when a lease expires,
> it is not called with "del".
> 
> To test, I changed lease time to 1 minute and kept an eye on
> /var/lib/misc/dnsmasq.leases . After 1 minute, the lease disappeared
> from /var/lib/misc/dnsmasq.leases (thus expired).
> However, the 'dhcp-script' was not called.
> 
> How could I start researching this issue?
> 

Go see what dnsmasq can see from the client.



Regards
Geert Stappers
-- 
Silence is hard to parse

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss