I have a iface hotplug script running in a VMware (OpenWrt 19.07.3), which gets not triggered on a reboot when the interface comes up, but it gets triggered on a network restart
.
/etc/hotplug.d/iface/99-netmap
#!/bin/sh
echo $ACTION $INTERFACE >> /tmp/if_dbg
/etc/config/network
config interface 'lan'
option type 'bridge'
option ifname 'eth0'
option proto 'dhcp'
...
After a reboot br-lan is available and already got an IP address via DHCP.
root@test-r1:~# ifconfig
br-lan Link encap:Ethernet HWaddr 00:0C:29:3B:DE:43
inet addr:192.168.90.157 Bcast:192.168.90.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe3b:de43/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:581 errors:0 dropped:0 overruns:0 frame:0
TX packets:121 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:228129 (222.7 KiB) TX bytes:20981 (20.4 KiB)
eth0 Link encap:Ethernet HWaddr 00:0C:29:3B:DE:43
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4863 errors:0 dropped:2 overruns:0 frame:0
TX packets:121 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1205914 (1.1 MiB) TX bytes:20981 (20.4 KiB)
Interrupt:19 Base address:0x2000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:24 errors:0 dropped:0 overruns:0 frame:0
TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2112 (2.0 KiB) TX bytes:2112 (2.0 KiB)
tun1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.102.0.11 P-t-P:10.102.0.11 Mask:255.255.0.0
inet6 addr: fe80::21b4:75c2:45fe:948b/64 Scope:Link
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 B) TX bytes:304 (304.0 B)
But the file if_dbg
from 99-netmap
gets not created during the boot, means to me that the script gets not executed.
root@test-r1:~# ls /tmp/if_dbg
ls: /tmp/if_dbg: No such file or directory
If I run a network restart, then the 99-netmap
iface hotplug script gets executed properly.
root@test-r1:~# /etc/init.d/network restart
Debug file exists after network restart.
root@test-r1:~# ls /tmp/if_dbg
/tmp/if_dbg
Somtimes it gets only partially called by some IFs during the boot:
root@test-r1:~# cat /tmp/if_dbg
ifup loopback
ifdown wan_3g
root@test-r1:~# /etc/init.d/network restart
root@test-r1:~# cat /tmp/if_dbg
ifup loopback
ifdown wan_3g
ifup loopback
ifdown wan_3g
ifup lan
ifup lan
Why is my hotplug script 99-netmap
not called (or only partially) during the boot process when the lan
interface is coming up?