Create a init.d file and add /etc/init.d/ and set it to executable like below:
chmod +x /etc/init.d/start_my_app
You can create a symlink to /etc/init.d/ if the above doesn’t run:
ln -s /etc/init.d/start_my_app /etc/rc.d/
To avoid any unexpected errors, put the absolute path of your script like below and add #!/bin/sh on top of the file:
/var/myscripts/start_my_app
Interested in Linux? Check out this Linux Certification by Intellipaat.