How to run udhcp in background for imx6_yocto ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to run udhcp in background for imx6_yocto ?

971 Views
haemachandars
Contributor I

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 ?

Labels (1)
0 Kudos
Reply
1 Reply

756 Views
b36401
NXP Employee
NXP Employee

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!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply