How to autorun compiled program when the router powered on?

I compiled a program then I installed it to my openwrt router. I want to make this program autorun when the router is powered on.

How can I do this feature ?

Please help me.

Let assume this is my program.

    #include <stdio.h>
    int main(void)
        printf("\nHello, world!\n\n");
        return 0;

If you do not have/want an init script you can add it to /etc/rc.local. That runs the program at the end of the boot process


what he said ....

1 Like

The example couldn't be much worse...

If that is your program, you will likely see nothing, as there is no console for most processes (and you are printing to the console stdout)...