I'm using imx6 sabreliteauto with Yocto Linux kernel 3.10.17 and recipe is core-image-x11. The udhcp is used for the getting the dhcp of the eth0 interface at the boot. After booting , If I remove and reconnect the ethernet interface. The udhcp is not run again and no leases file are generated (as in dhclient). I have to manually run the udhcp again to update the dhcp of ethernet interface. How to run the udhcp in background ?
You can run in background something like this:
# tail -1f /var/log/messages | grep "link becomes ready" | awk '{system("/sbin/udhcpc")}'
It cyclically waits for "link becomes ready" appears in /var/log/messages and then runs udhcpc program.
Have a great day,
Victor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------