This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

init.rc custom process not starting up?

Hi all,

I have added some tools to my custom build of Gingerbread 2.3.4 for the BeagleBoard.  Specifically, I have gotten the linux wireless 'iw' tool installed.  I would like to run a command with iw and ifconfig from my init.rc, and have tried the obvious things without any luck.

The commands I want to run in sequence are:

iw phy phy0 interface add mesh0 type mp mesh_id mymesh

ifconfig mesh0 192.168.80.4

These commands work perfectly from the serial console (I have a beagleboard XM).  The 2 things I have tried are in the init.rc file, to type the 2 commands as shown above, before the section where all the services are defined.  That didn't work.  The second thing I tried was to start 2 services as shown below.

# Try to automate mesh creation
service meshcreate /system/bin/iw phy phy0 interface add mesh0 type mp mesh_id mymesh
    user meshcreate
    group meshcreate
    oneshot
service assignmeship /system/bin/ifconfig mesh0 192.168.80.4
    user assignmeship
    group assignmeship
    oneshot

The ifconfig program comes standard with the sourcecode released by TI, and IW is something that I installed. 

Thanks in advance.

Kiran

  • Hi,

    Please try with the following.

    Create a script somewhere for example, /system/bin/mymod.rc

    #!/system/bin/sh

    iw phy phy0 interface add mesh0 type mp mesh_id mymesh

    ifconfig mesh0 192.168.80.4

    Add the following in /init.rc:
      service myscript /system/bin/mymod.rc
        oneshot

    Regards,

    Pankaj Bharadiya

  • Hi,

    Thanks for responding so quickly.  I tried your suggestion.  At the end of my init.rc file, I had the following:

    # automate mesh creation
    service myscript /system/bin/mymod.rc
        oneshot

    In /system/bin, I have a file called mymod.rc, which contains the following code:

    #!/system/bin/sh
    iw phy phy0 interface add mesh0 type mp mesh_id mymesh
    ifconfig mesh0 192.168.80.4

    After the beagleboard starts up, I tried the command 'ifconfig mesh0', and I got a response saying that the interface didn't exist.  Do you have any other ideas as to why this wouldn't work?

    Thanks again,
    Kiran

  • Sorry I jumped the gun.  I also had to change the permissions of the mymod.rc file to 755, user to root, and group to 2000, and it worked.

    Thanks for the help,

    Kiran