Reply
Thread Tools
Posts: 63 | Thanked: 13 times | Joined on Jun 2008
#1
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.
__________________
An extreme Linux newbee so please talk sloooowly and with great detail
Using my NITs primarily as a wireless UI for my home automation software via a RDP connection.
 
penguinbait's Avatar
Posts: 3,096 | Thanked: 1,525 times | Joined on Jan 2006 @ Michigan, USA
#2
Originally Posted by sic0048 View Post
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.
You can take a look at this.

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
__________________
To all my Maemo friends. I will no longer be monitoring any of my threads here on a regular basis. I am no longer supporting anything I did under maemo at maemo.org. If you need some help with something you can reach me at tablethacker.com or www.facebook.com/penguinbait. I have disabled my PM's here, and removed myself from Council email and Community mailing list. There has been some fun times, see you around.
 

The Following 2 Users Say Thank You to penguinbait For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 03:23.