Legato application run time prioritization

On my MangoH red board, ecm0 is not assigned to 192.168.2.2 on boot up, but can be manually assigned after bootup.

Wrote a sample legato application, to assign the ecm0 to 192.168.2.2, but still after boot up, the app needs to be re-run. “app restart ecmStart”

Below is my code, anything is missing ?

Application:
COMPONENT_INIT
{
system("/sbin/ifconfig ecm0 192.168.2.2");
LE_INFO(“Configured ecm0 \n”);
}

.adef
sandboxed: false
executables:
{
ecmStart = ( ecmStartComponent )
}

start:auto
processes:
{
envVars:
{
LE_LOG_LEVEL = DEBUG
}

run:
{
    ( ecmStart )
}
    maxCoreDumpFileBytes: 512K
    maxFileBytes: 512K

}

version: 1.0.0
maxFileSystemBytes: 512K

How about adding sleep() in the app before calling

system("/sbin/ifconfig ecm0 192.168.2.2");

add sleep(1) before the system call, but no luck.

How about sleep(10)???

Felt too huge a sleep for the legato app, but it did work for me.
Thank you!!

But How can a sleep help in this ?

you can tune the timing.
Probably the legato app is too early to call ifconfig

thanks again!! will tune in the values