[Dnsmasq-discuss] dhcp-script: environment var DNSMASQ_INTERFACE not always set

2023-08-06 Thread Bastian Bittorf
e it is not obvious and *should not happen* 8-) => except 'data.interface' 
is unknown.
This happens on different CPU architectures, at least: mips, arm and powerpc.

I'am happy to test patches or suggestions.
Thanks for your great work & bye,
Bastian Bittorf

[1] 
https://github.com/bittorf/kalua/blob/master/openwrt-addons/etc/dhcp-script.d/10dhcpscript
 

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


Re: [Dnsmasq-discuss] problem with loopback and 2.77test5

2017-05-10 Thread Bastian Bittorf
* Simon Kelley  [10.05.2017 15:05]:
> I wonder if this is to do with the extension of the ping-test to more
> cases. Please could you try adding
> 
> no-ping
> 
> to the config, and see if that improves things?

thank you - yes, that works...now the log shows:

dnsmasq-dhcp[28815]: DHCPREQUEST(lo) 127.0.0.2 00:00:00:00:00:00
dnsmasq-dhcp[28815]: DHCPACK(lo) 127.0.0.2 00:00:00:00:00:00 lo-alias
dnsmasq-dhcp[28815]: ARP-cache injection failed: Invalid argument

could it be, because 'loopback' is not arp-able?

bye, bastian

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


[Dnsmasq-discuss] problem with loopback and 2.77test5

2017-05-10 Thread Bastian Bittorf
here the relevant things with recent lede-project.org

root@box:~ dnsmasq -v
Dnsmasq version 2.77test5  Copyright (c) 2000-2016 Simon Kelley
Compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP
no-DHCPv6 no-Lua TFTP no-conntrack no-ipset no-auth no-DNSSEC no-ID
loop-detect inotify

# kernel tested with non working version: 4.4.61
# kernel tested with working version 4.4.56

# this is repeating in syslog every 3 seconds:
Wed May 10 12:47:55 2017 daemon.warn dnsmasq-dhcp[21993]:
 not using configured address 127.0.0.2 because it is in use by another host
Wed May 10 12:47:55 2017 daemon.info dnsmasq-dhcp[21993]:
 DHCPDISCOVER(lo) 00:00:00:00:00:00 no address available

# here the exact same config which is working with 2.77test4:
root@box:~ :) cat /var/etc/dnsmasq.conf.cfg02411c
# auto-generated config file from /etc/config/dhcp
conf-file=/etc/dnsmasq.conf
dhcp-authoritative
localise-queries
read-ethers
expand-hosts
dhcp-script=/etc/dhcp-script.d/10dhcpscript
cache-size=1000
domain=internet
server=/internet/
server=8.8.8.8
except-interface=eth0.2
except-interface=wlan0-1
except-interface=wlan1-1
addn-hosts=/var/run/hosts_olsr
addn-hosts=/etc/local.hosts
dhcp-leasefile=/tmp/dhcp.leases
resolv-file=/tmp/resolv.conf.auto
dhcp-broadcast=tag:needs-broadcast
addn-hosts=/tmp/hosts
conf-dir=/tmp/dnsmasq.d
user=dnsmasq
group=dnsmasq

dhcp-host=00:00:00:00:00:00,127.0.0.2,lo-alias

bogus-priv
conf-file=/usr/share/dnsmasq/rfc6761.conf
dhcp-range=set:lan,10.63.22.98,10.63.22.110,255.255.255.240,48h
dhcp-range=set:mastergate,100.66.19.2,100.66.19.254,255.192.0.0,12h
dhcp-option=mastergate,3,100.64.0.1
dhcp-option=mastergate,6,100.64.0.1
no-dhcp-interface=eth0.2
dhcp-range=set:loopback,127.0.0.2,127.0.0.3,255.0.0.0,1h
# end-of-config


# on a working version i get a lease:
root@box:~ :) cat /tmp/dhcp.leases 
1494416311 00:00:00:00:00:00 127.0.0.2 lo-alias *

we use this "strange" method, for checking if everything is
working and the lease gets renewed (and some hotplug scripts are
fired)

thanks & bye, bastian

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


Re: [Dnsmasq-discuss] dhcp-script and concurrency/parallel execution

2015-06-08 Thread Bastian Bittorf
* Nicolas Cavallari nicolas.cavall...@green-communications.fr [08.06.2015 
19:58]:
 This is already the current behavior (helper.c:455).  If you see lots
 of dhcp-script running, then you have another problem, probably bugs
 in your dhcp-script.  Does it fork or run background commands ?

i checked my scripts again and again - i have to apologize:
the parallel execution comes from another source.
(i called the script from another script)

so: everything is ok - thanks for pointing to helper.c:455

bye, bastian

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


[Dnsmasq-discuss] dhcp-script and concurrency/parallel execution

2015-06-08 Thread Bastian Bittorf
there is nothing about this issue in the docs or
in the archive, so i will ask you.

i have seen a lot of running instances of dhcp-script
on an embedded box (OpenWrt, 2.73rc8).
this is a problem in 2 ways:

1)
memory consumption

2)
concurrency, because we read/write into files
with the same filename

at least there should be an explicit mention of that
behaviour in the docs. also we should consider to have
an option e.g. 'scriptwait' which wait till the script
is terminated before the next call is started...

what do you think about that?

bye, bastian

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


Re: [Dnsmasq-discuss] problem with not executed /etc/dhcp-script.d/10dhcpscript

2015-05-08 Thread Bastian Bittorf
* Simon Kelley si...@thekelleys.org.uk [08.05.2015 22:36]:
 Are you sure the low-memory thing is relevant? Do you see the same
 problem on a newly booted machine?

i'am not sure, if the lowmem-situation is relevant.
on a newly booted machine there are no problems.

 The logs you include are odd. Doing DHCP on the loopback interface is
 unusual, and may be a cause.

it is unusual but it works. this is just some sort of watchdog.
and not part of the problem. the interesting thing is, that dnsmasq
is still running (as seen in the log). just the script does not
get executed anymore...

for now we should keep it in the archive. it will
poke you again, if i can see it again. what should i do
in that situation? does a 'kill -SIGSEGV $pid' with coredump help?

bye, bastian

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


[Dnsmasq-discuss] problem with not executed /etc/dhcp-script.d/10dhcpscript

2015-04-30 Thread Bastian Bittorf
(only CC'ing to openwrt-dev)

under unclear circumstances, dnsmasq does not execute anymore
the dhcp-script. the box in question had a short lowmem-situation,
but dnsmasq itself was not effected (but crond/netifd). dhcp-actions are
working normally. i have debug-output in the first line of the script,
so i can see if it's executed. if i run the script manually, it works...

here some output of the still running OpenWrt-router with dnsmasq v2.72

root@box:~ ps
  PID USER   VSZ STAT COMMAND
1 root  1396 S/sbin/procd
2 root 0 SW   [kthreadd]
3 root 0 SW   [ksoftirqd/0]
4 root 0 SW   [kworker/0:0]
5 root 0 SW  [kworker/0:0H]
6 root 0 SW   [kworker/u2:0]
7 root 0 SW  [khelper]
8 root 0 SW   [kworker/u2:1]
   58 root 0 SW  [writeback]
   61 root 0 SW  [bioset]
   63 root 0 SW  [kblockd]
   95 root 0 SW   [kswapd0]
  142 root 0 SW   [fsnotify_mark]
  159 root 0 SW   [spi0]
  254 root 0 SW  [deferwq]
  276 root 0 SW   [khubd]
  345 root 0 SWN  [jffs2_gcd_mtd3]
 1810 root 0 SW  [ipv6_addrconf]
 1898 root 0 SW  [cfg80211]
 2047 root  1044 S/sbin/logd -S 16
 2409 root  1364 Sudhcpc -p /var/run/udhcpc-lo.pid -s 
/lib/netifd/dhcp.script -f -t 0 -i lo -C
 2814 nobody1072 S/usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf -k
 2815 root  1000 S/usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf -k
 3028 root  1152 S/usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 
22 -K 300
 3977 root  1136 S/usr/sbin/uhttpd -f -h /www -r box -c /etc/httpd.conf 
-x /cgi-bin -t 15 -T 20 -A 1 -E /cgi-bin-404.sh -n 50 -p 80
13467 root   876 S/sbin/ubusd
13520 root 0 SW   [kworker/0:1]
13521 root  1196 R/usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 
22 -K 300
13522 root  1548 S-ash
13568 root  1364 Rps

root@box:~ free
 total used free   shared  buffers
Mem: 2882819860 89680 1444
-/+ buffers:  1841610412
Swap:14332 335210980

root@box:~ uname -a
Linux box 3.14.29 #10 Mon Jan 26 16:54:10 CET 2015 mips
GNU/Linux

root@box:~ cat /var/etc/dnsmasq.conf
conf-file=/etc/dnsmasq.conf
dhcp-authoritative
localise-queries
read-ethers
bogus-priv
expand-hosts
dhcp-script=/etc/dhcp-script.d/10dhcpscript
cache-size=1000
domain=lan
server=/lan/
server=8.8.8.8
except-interface=eth0.2
addn-hosts=/var/run/hosts_olsr
addn-hosts=/etc/local.hosts
dhcp-leasefile=/tmp/dhcp.leases
resolv-file=/tmp/resolv.conf.auto
addn-hosts=/tmp/hosts
conf-dir=/tmp/dnsmasq.d
dhcp-broadcast=tag:needs-broadcast

dhcp-host=00:00:00:00:00:00,127.0.0.2,lo-alias

no-dhcp-interface=eth0.1
dhcp-range=wlan,10.10.35.2,10.10.35.123,255.255.255.128,1h
no-dhcp-interface=eth0.2
dhcp-range=loopback,127.0.0.2,127.0.0.3,255.0.0.0,1h

root@box:~ logread | grep dnsmasq
Thu Apr 30 04:33:49 2015 daemon.info dnsmasq[2814]: time 1430361229
Thu Apr 30 04:33:49 2015 daemon.info dnsmasq[2814]: cache size 1000, 0/26 cache 
insertions re-used unexpired cache entries.
Thu Apr 30 04:33:49 2015 daemon.info dnsmasq[2814]: queries forwarded 20, 
queries answered locally 72
Thu Apr 30 04:33:49 2015 daemon.info dnsmasq[2814]: server 8.8.8.8#53: queries 
sent 20, retried or failed 0
Thu Apr 30 04:33:49 2015 daemon.info dnsmasq[2814]: read /etc/hosts - 1 
addresses
Thu Apr 30 04:33:49 2015 daemon.info dnsmasq[2814]: read /tmp/hosts/dhcp - 1 
addresses
Thu Apr 30 04:33:49 2015 daemon.info dnsmasq[2814]: read /etc/local.hosts - 274 
addresses
Thu Apr 30 04:33:49 2015 daemon.info dnsmasq[2814]: read /var/run/hosts_olsr - 
359 addresses
Thu Apr 30 04:33:49 2015 daemon.info dnsmasq-dhcp[2814]: read /etc/ethers - 0 
addresses
Thu Apr 30 04:43:39 2015 daemon.info dnsmasq-dhcp[2814]: DHCPREQUEST(lo) 
127.0.0.2 00:00:00:00:00:00 
Thu Apr 30 04:43:39 2015 daemon.info dnsmasq-dhcp[2814]: DHCPACK(lo) 127.0.0.2 
00:00:00:00:00:00 lo-alias
Thu Apr 30 05:13:39 2015 daemon.info dnsmasq-dhcp[2814]: DHCPREQUEST(lo) 
127.0.0.2 00:00:00:00:00:00 
Thu Apr 30 05:13:39 2015 daemon.info dnsmasq-dhcp[2814]: DHCPACK(lo) 127.0.0.2 
00:00:00:00:00:00 lo-alias
Thu Apr 30 05:43:40 2015 daemon.info dnsmasq-dhcp[2814]: DHCPREQUEST(lo) 
127.0.0.2 00:00:00:00:00:00 
Thu Apr 30 05:43:40 2015 daemon.info dnsmasq-dhcp[2814]: DHCPACK(lo) 127.0.0.2 
00:00:00:00:00:00 lo-alias
Thu Apr 30 06:13:40 2015 daemon.info dnsmasq-dhcp[2814]: DHCPREQUEST(lo) 
127.0.0.2 00:00:00:00:00:00 
Thu Apr 30 06:13:40 2015 daemon.info dnsmasq-dhcp[2814]: DHCPACK(lo) 127.0.0.2 
00:00:00:00:00:00 lo-alias
Thu Apr 30 06:43:40 2015 daemon.info dnsmasq-dhcp[2814]: DHCPREQUEST(lo) 
127.0.0.2 00:00:00:00:00:00 
Thu Apr 30 06:43:40 2015 daemon.info dnsmasq-dhcp[2814]: DHCPACK(lo) 127.0.0.2 
00:00:00:00:00:00 lo-alias
Thu Apr 30 07:13:40 2015 daemon.info dnsmasq-dhcp[2814]: DHCPREQUEST(lo) 
127.0.0.2