OpenWrt Forum Archive

Topic: [patch] udhcpc fails script execution

The content of this topic has been archived on 29 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all,
In startscript "target/default/target_skeleton/etc/init.d/S50dnsmasq", there is a problem with the execution of the udhcpc script when running. It tries to execute /dev/zero, which is not a valid script. Changing the script to /bin/true works much better:

--- target/default/target_skeleton/etc/init.d/S50dnsmasq        25 Jun 2005 06:38:42 -0000      1.5.2.1
+++ target/default/target_skeleton/etc/init.d/S50dnsmasq        17 Jul 2005 00:10:41 -0000
@@ -9,7 +9,7 @@
 netmask=$(nvram get ${iface}_netmask)

 # check for existing DHCP server
-udhcpc -n -q -R -s /dev/zero -i $ifname >&- || {
+udhcpc -n -q -R -s /bin/true -i $ifname >&- || {

   ipaddr=$(ip2int $ipaddr)
   netmask=$(ip2int ${netmask:-255.255.255.0})

Greetings Bertho

I'll change it, but the point was simply to test for a dhcp server. The script specified really makes no difference as we have no intention of actually using the IP given; the IP is immediately released.

The discussion might have continued from here.