Overriding udchcp flags used by ifup in BusyBox

busyboxudhcpc

I am working on a system that I did not create the BusyBox build for. I do not want to recompile BusyBox for fear that my configuration will not completely match the original and besides this the system is functioning well enough on this build. I could be swayed to do this if I knew of a way to pull the configuration of a running BusyBox install much like a running kernel.

I am trying to figure out how to disable the switches used to call udhcpc from the ifup command. I can see the defaults compiled into the build that I am using. They are -R -n -p. I want for this process to fork into the background and I thought using udhcpc_opts -b in /etc/networking/interfaces would solve this issue. I get the fork to the background and then the process kills. If i just call udhcpc -b it forks to the background indefinitely.

Is there a way to override the -n switch through something I can put into udhcpc_opts? Thank you.

Best Answer

Having the same problem, did not want to recompile busybox and wanted to use those flags: "-t 0 -b" to let udhcpc try forever in background, but could not avoid flag "-n" that is passed by default by ifup.

As a super-hack (but it worked for me) I used the following options for udhcpc_opts in /etc/network/interfaces:

udhcpc_opts -t 0 -T 10 -A 20 -S &

The final "&" did the trick, as it launchs udhcpc as a background task and is almost the same of the "-b" flag, but works also if the "-n" is specified in the command line.

Note, that it has to be added to iface option to work, eg:

iface eth0 inet dhcp
    udhcpc_opts -t 0 -T 10 -A 20 -S &
Related Question