How to implement program autorun when Linux Boot-up

Sometimes, we need program autorun when the Linux OS  Boot-up,  so we can:

1. Create a script for the program to the /etc/init.d directory.
    e.g. 
   // for  /usr/MyApp
   // create a script --- MyApp.sh,  edit it:
   /usr/MyApp > /dev/null  2>&1 & 

2. Make sure MyApp.sh can be execute, so:
   chmod  +x

3. Create a linke to MyApp.sh in the /etc/rc2.d   folder.
   ln -s  /etc/init.d/MyApp.sh    /etc/rc2.d/S99MyApp


OK!

 

你可能感兴趣的:(linux)