![]() |
Need to auto start a program at boot
OK - forgive me but I am a linux idiot. So hopefully this is an easy question. I need to start a script after the NIT boots and is fully operational (ie connected to the network, etc). What is the easiest way to accomplish this?
Basically I need the equivalent of the "Start Up" folder in windows. Thanks. |
Re: Need to auto start a program at boot
Quote:
http://nixshell.wordpress.com/2007/0...-init-scripts/ Basically you have a directory in /etc called init.d If you look in /etc/init.d you will see scripts These scripts are called like /etc/init.d/script.sh start or /etc/init.d/script.sh stop The start will start the script, the opt will stop the script. Once you create a script that can be (at least) started. You then need to make sure it starts on boot.. /etc/init.d is just where the scripts live There are more directories in /etc /etc/rc0.d /etc/rc1.d /etc/rc2.d /etc/rc3.d /etc/rc4.d /etc/rc5.d /etc/rc6.d Basically when the system reaches the corresponding runlevel those scripts are called. Maemo boots up to runlevel 2 So you cd /etc/rc2.d Then you would link the script to this directory If you do an ls (LS) you will see lots of links starting with S or K. When entering runlevel 2 it will start in order the S script links. So if you wanted your script to start last, you would link it to the highest number. cd /etc/rc2.d ln -s /etc/init.d/script.sh S99scripttocall Now it will start on boot |
All times are GMT. The time now is 04:05. |
vBulletin® Version 3.8.8