Re: [Dnsmasq-discuss] Copying dnsmasq.leases, any issues to be aware of?

2022-02-08 Thread Matus UHLAR - fantomas via Dnsmasq-discuss

On 08.02.22 19:32, Ed W wrote:

This is never going to get high enough up my todo list to try, but I did wonder 
if a simple
"clustered" system could be built using DBUS or similar events. When a lease is 
allocated DBUS (and
a script) is run notifying about that. A little daemon could then use this hook 
to notify another
instance of dnsmasq. In fact I think the hook is run synchronously? So it 
should be possible to ship
new leases across to the other instance

I can think of a number of ways this can be racy... However, for a little home 
lab it would surely
be good enough. I'm not sure how to handle failover, but a few simple ideas 
spring to mind (I'm
thinking of a pure warm standby kind of setup, where something promotes the 
secondary to primary)

Anyway, just shooting the breeze...


I believe Simon's answer means: dnsmasq is small server for small systems. If
you need cluster-like features, you should try isc or kea dhcp servers.



On 05/02/2022 11:06, Simon Kelley wrote:

It could work; there's a whole IETF standard for DHCP failover and it's 
implemented beautifully by
ISC dhcp. If that's your niche, then ISC is the way to go.


--
Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
If Barbie is so popular, why do you have to buy her friends?

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


Re: [Dnsmasq-discuss] Copying dnsmasq.leases, any issues to be aware of?

2022-02-08 Thread Ed W
Simon,

This is never going to get high enough up my todo list to try, but I did wonder 
if a simple
"clustered" system could be built using DBUS or similar events. When a lease is 
allocated DBUS (and
a script) is run notifying about that. A little daemon could then use this hook 
to notify another
instance of dnsmasq. In fact I think the hook is run synchronously? So it 
should be possible to ship
new leases across to the other instance

I can think of a number of ways this can be racy... However, for a little home 
lab it would surely
be good enough. I'm not sure how to handle failover, but a few simple ideas 
spring to mind (I'm
thinking of a pure warm standby kind of setup, where something promotes the 
secondary to primary)

Anyway, just shooting the breeze...

Ed W

On 05/02/2022 11:06, Simon Kelley wrote:
> It could work; there's a whole IETF standard for DHCP failover and it's 
> implemented beautifully by
> ISC dhcp. If that's your niche, then ISC is the way to go.
>
> Simon.
> rent instances of dnsmasq on the
>> network
>>    - use UDP to 'copy' each new lease  to the other instance
>>    - on startup, use UDP to request a sync of known leases from the other 
>> instance
>>    - maybe sync local DNS entries as well (though it might be less desirable 
>> for folks
>>  like me who have 850k 'undefined' entries for ads, pron, warez, etc.)
>>
>> Could this even work? Would it be worth the effort? 


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


Re: [Dnsmasq-discuss] [BUG] Broken SIGHUP handling in 2.86, regression from 2.85

2022-02-08 Thread Charlie Turner
On Tue, 2022-02-08 at 10:44 +, Simon Kelley wrote:
> Please could you send the entire strace, to me direct if you prefer. 
> It's much easier to work out what file descriptor is in use, than 
> therefore which code is broken if you have the syscalls that create
> them.

Sure, I will send you the full trace directly.

B.R.

  Charlie.

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


Re: [Dnsmasq-discuss] restarting

2022-02-08 Thread Simon Kelley

On 07/02/2022 07:56, Ken Gillett via Dnsmasq-discuss wrote:

On MacOS, dnsmasq is started and run by launchd, so launchctl would normally be 
used to stop and start. Instead however, a simple 'killall dnsmasq' will stop 
it and launchd will automatically restart it. Does it matter to dnsmasq which 
method is used?


I'm no expert on MacOS, but I'd be surprised if they were not equivalent.


What is the best way to tell dnsmasq to just reread the config files (to 
include changes etc)? Is a full stop and restart required, or does it respond 
to any particular signal by simply re-loading its configuration?



Both. SOME configuration can be re-read. Some requires a stop and 
restart. It's all in the man page.



Simon.





Ken  G i l l e t t

_/_/_/_/_/_/_/_/




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




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


[Dnsmasq-discuss] Simon away again.

2022-02-08 Thread Simon Kelley
My long delayed move is suddenly on again, so I'm likely to be absent 
for a little while. At least until I can organise am Internet connection 
halfway up an Irish mountain.


Simon.


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


Re: [Dnsmasq-discuss] Feature request = block-conf

2022-02-08 Thread Simon Kelley

On 06/02/2022 21:31, Ercolino de Spiacico wrote:

 From what version is this --conf-script made available?



I've just added it to 2.87test8

Please test and report back.


Simon.


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


Re: [Dnsmasq-discuss] [BUG] Broken SIGHUP handling in 2.86, regression from 2.85

2022-02-08 Thread Simon Kelley
Please could you send the entire strace, to me direct if you prefer. 
It's much easier to work out what file descriptor is in use, than 
therefore which code is broken if you have the syscalls that create them.



Cheers,

Simon.


On 08/02/2022 09:55, Charlie Turner wrote:

`dnsmasq' has regressed in its handling of SIGHUP between 2.85 and
2.86. The `strace' record shows correct behaviour.

When `dnsmasq' boots, but before serving any `BOOTP=/=DHCP' requests, I
can send as many `SIGHUPs' as I like to have the service reread its
configuration files without restarting it. `strace' looks like this
(for
reference to a later capture),

--- SIGHUP {si_signo=SIGHUP, si_code=SI_USER, si_pid=2127, si_uid=0} --
-
  │getpid()= 492050

I can repeat this `SIGHUP' as many times as I want, successfully.

When I network boot a machine on the interface `dnsmasq' is listening,
`dnsmasq' enters a syscall. Sending a `SIGHUP' now causes a `SIGABRT',

) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
│--- SIGHUP {si_signo=SIGHUP, si_code=SI_USER, si_pid=2127, si_uid=0} -
--
│getpid()= 485420
│writev(10, [{iov_base="\1\0\0\0\0\0\0\0\0\0\0\0", iov_len=12}], 1) =
12
│rt_sigreturn({mask=[]}) = -1 EINTR (Interrupted system
call)
│poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6,
events=POLLIN}, {fd=7, events=POLLIN}, {
│fd=8, events=POLLIN}, {fd=9, events=POLLIN}], 6, -1) = 1 ([{fd=9,
revents=POLLIN}])
│read(9, "\1\0\0\0\0\0\0\0\0\0\0\0", 12) = 12
│writev(2, [{iov_base="free(): invalid pointer", iov_len=23},
{iov_base="\n", iov_len=1}], 2) = 24
│mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x7ff941ac8000
│rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
│rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
│getpid()= 485420
│gettid()= 485420
│tgkill(485420, 485420, SIGABRT) = 0
│rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
│--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=485420,
si_uid=65534} ---
│+++ killed by SIGABRT +++

I can see `dnsmasq' is within some syscall, and is not handling the
restart request correctly.

B.R.

   Charlie.

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


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


[Dnsmasq-discuss] [BUG] Broken SIGHUP handling in 2.86, regression from 2.85

2022-02-08 Thread Charlie Turner
`dnsmasq' has regressed in its handling of SIGHUP between 2.85 and
2.86. The `strace' record shows correct behaviour.

When `dnsmasq' boots, but before serving any `BOOTP=/=DHCP' requests, I
can send as many `SIGHUPs' as I like to have the service reread its
configuration files without restarting it. `strace' looks like this
(for
reference to a later capture),

--- SIGHUP {si_signo=SIGHUP, si_code=SI_USER, si_pid=2127, si_uid=0} --
-   
 │getpid()= 492050

I can repeat this `SIGHUP' as many times as I want, successfully.

When I network boot a machine on the interface `dnsmasq' is listening,
`dnsmasq' enters a syscall. Sending a `SIGHUP' now causes a `SIGABRT',

) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)   
│--- SIGHUP {si_signo=SIGHUP, si_code=SI_USER, si_pid=2127, si_uid=0} -
--   
│getpid()= 485420 
│writev(10, [{iov_base="\1\0\0\0\0\0\0\0\0\0\0\0", iov_len=12}], 1) =
12
│rt_sigreturn({mask=[]}) = -1 EINTR (Interrupted system
call)
│poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6,
events=POLLIN}, {fd=7, events=POLLIN}, {
│fd=8, events=POLLIN}, {fd=9, events=POLLIN}], 6, -1) = 1 ([{fd=9,
revents=POLLIN}])
│read(9, "\1\0\0\0\0\0\0\0\0\0\0\0", 12) = 12
│writev(2, [{iov_base="free(): invalid pointer", iov_len=23},
{iov_base="\n", iov_len=1}], 2) = 24
│mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x7ff941ac8000
│rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
│rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
│getpid()= 485420
│gettid()= 485420
│tgkill(485420, 485420, SIGABRT) = 0
│rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
│--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=485420,
si_uid=65534} ---
│+++ killed by SIGABRT +++ 

I can see `dnsmasq' is within some syscall, and is not handling the
restart request correctly.

B.R.

  Charlie.

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