Init Script File in Ubuntu
If we have create one execution file, for example in /usr/local/bin/mirror . Can we put this file as init script file and always run while startup and everytime our linux system will check it ??? Off course we can use cron to make it a routine execution file, but I will use other way.
Here are my experience when I am trying to have an init script :
First chmod 755 /usr/local/bin/mirror :
[email protected]:$ sudo chmod 755 /usr/local/bin/mirror
[email protected]:$ sudo vi /etc/init.d/mirror
/usr/local/bin/mirror >/dev/null 2>&1 &
[email protected]:~$ sudo chmod 755 /etc/init.d/mirror
[email protected]:~$ cd /etc/rc2.d/
[email protected]:/etc/rc2.d$ sudo ln -s /etc/init.d/mirror S70mirror
And now we have an execution file that will running as an init script.