How to run udhcp in background for imx6_yocto ?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to run udhcp in background for imx6_yocto ?

864 次查看
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 ?

标签 (1)
0 项奖励
回复
1 回复

649 次查看
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 项奖励
回复