maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   How to make a script be automatically ran at boot? (https://talk.maemo.org/showthread.php?t=71404)

JadeH 2011-03-23 23:07

How to make a script be automatically ran at boot?
 
Hey, I wrote a simple (bash) script to do some stuff on my N900 that would need to ideally be started at boot, the script takes care of the rest (sleeping for a while, looping, etc), so it would only needed to be started whenever the N900 boots.. but how? I tried to search a bit on the forums but didn't really find anything.

Thanks!

epitaph 2011-03-23 23:16

Re: How to make a script be automatically ran at boot?
 
Quote:

Originally Posted by JadeH (Post 974288)
Hey, I wrote a simple (bash) script to do some stuff on my N900 that would need to ideally be started at boot, the script takes care of the rest (sleeping for a while, looping, etc), so it would only needed to be started whenever the N900 boots.. but how? I tried to search a bit on the forums but didn't really find anything.

Thanks!

Take a look in /etc/event.d there are many startup scripts. You want to use this template

PHP Code:

start on started rcS-late
script
foobar
more foobar
end script 

But there is no way to debug ( if you don't use the sdk ) so be sure you want it!

JadeH 2011-03-23 23:17

Re: How to make a script be automatically ran at boot?
 
Thanks, I'll try that out!

JonWW 2011-03-23 23:47

Re: How to make a script be automatically ran at boot?
 
If you just have to run stuff once each startup then place your script in /etc/event.d
If your script stays in ram monitoring things then, write a startup script in /etc/event.d but put the main script in /etc/init.d
As epitaph says there are lots of examples in both directories for you to learn from.

epitaph 2011-03-24 00:01

Re: How to make a script be automatically ran at boot?
 
Quote:

Originally Posted by JonWW (Post 974307)
If you just have to run stuff once each startup then place your script in /etc/event.d
If your script stays in ram monitoring things then, write a startup script in /etc/event.d but put the main script in /etc/init.d
As epitaph says there are lots of examples in both directories for you to learn from.

Why not put the main script in /opt inside an application folder? It doesn't take that much diskspace from rootfs.

JadeH 2011-03-24 00:49

Re: How to make a script be automatically ran at boot?
 
I managed to get it working by using that template epitaph wrote and putting it in event.d, it's a really simple script, 5 lines long, so it doesn't really use much space


All times are GMT. The time now is 09:17.

vBulletin® Version 3.8.8