Quantcast

Application auto-run when angstrom boots up

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Application auto-run when angstrom boots up

chilchil
Hi,

I would like to start up an application automatically when the Angstrom linux boots up. Could anyone share the light of how to do this please?

Thanks a lot.

Qiu
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application auto-run when angstrom boots up

doubleg
Hello Qiu,

I was wondering if you have solved this issue?  I need to do the same thing you asked, but I can't seem to figure it out.  If you have information you can share, I would appreciate it.

Thanks!

chilchil wrote
Hi,

I would like to start up an application automatically when the Angstrom linux boots up. Could anyone share the light of how to do this please?

Thanks a lot.

Qiu
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application auto-run when angstrom boots up

msinger


You could add an entry to inittab

oth:2345:once:/home/username/file_to_run

 

-----Original Message-----
From: doubleg [mailto:[hidden email]]
Sent: Thursday, March 11, 2010 1:00 PM
To: [hidden email]
Subject: Re: [Gumstix-users] Application auto-run when angstrom boots up


Hello Qiu,

I was wondering if you have solved this issue?  I need to do the same thing
you asked, but I can't seem to figure it out.  If you have information you
can share, I would appreciate it.

Thanks!


chilchil wrote:
>
> Hi,
>
> I would like to start up an application automatically when the
> Angstrom linux boots up. Could anyone share the light of how to do this
please?
>
> Thanks a lot.
>
> Qiu
>

--
View this message in context:
http://old.nabble.com/Application-auto-run-when-angstrom-boots-up-tp27321883
p27867142.html
Sent from the Gumstix mailing list archive at Nabble.com.


----------------------------------------------------------------------------
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.733 / Virus Database: 271.1.1/2734 - Release Date: 03/11/10
02:33:00


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application auto-run when angstrom boots up

doubleg
msinger wrote
You could add an entry to inittab

oth:2345:once:/home/username/file_to_run
OK, I'll give that a try.  Can you explain "oth" and "2345"?  I'm still on the steep learning curve :)

Thanks so much for the quick response.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application auto-run when angstrom boots up

kailoi
You might want to have a read of this.

http://it.toolbox.com/blogs/locutus/exploring-the-etc-directory-inittab-16139

inittab is just a linux control file that defines how various things
occur during the boot sequence.

I'm not sure what oth means. I've not seen that before. I suspect that
might be a typo... but 2345 tells inittab to start the program at all
the standard linux "runlevels" i.e 2, 3, 4, and 5. If you're not that
familiar with linux this is going to be a little tricky for you. ;)

You can start a program at boot about a million different ways. Try
googling for "linux start program at boot" and you'll find a million
different suggestions. Things like putting a script  in /etc/init.d
and calling it from the various run level dirs is another option.

Chris

On 12 March 2010 02:40, doubleg <[hidden email]> wrote:

>
>
> msinger wrote:
>>
>>
>> You could add an entry to inittab
>>
>> oth:2345:once:/home/username/file_to_run
>>
>>
>
> OK, I'll give that a try.  Can you explain "oth" and "2345"?  I'm still on
> the steep learning curve :)
>
> Thanks so much for the quick response.
> --
> View this message in context: http://old.nabble.com/Application-auto-run-when-angstrom-boots-up-tp27321883p27867930.html
> Sent from the Gumstix mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> gumstix-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gumstix-users
>

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application auto-run when angstrom boots up

doubleg
kailoi wrote
You might want to have a read of this.

http://it.toolbox.com/blogs/locutus/exploring-the-etc-directory-inittab-16139

inittab is just a linux control file that defines how various things
occur during the boot sequence.

I'm not sure what oth means. I've not seen that before. I suspect that
might be a typo... but 2345 tells inittab to start the program at all
the standard linux "runlevels" i.e 2, 3, 4, and 5. If you're not that
familiar with linux this is going to be a little tricky for you. ;)

You can start a program at boot about a million different ways. Try
googling for "linux start program at boot" and you'll find a million
different suggestions. Things like putting a script  in /etc/init.d
and calling it from the various run level dirs is another option.

Chris
Thank you Chris for the additional info!  I think I found a million different ways to do this on Google, and that was part of my problem.  With all the different "flavors" of Linux, I was having difficulty finding a method that matched up with Angstrom's file structure.  This inittab method sure looks like a simple way to go.  Again thank you for the reply.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application auto-run when angstrom boots up

coderdrone
I never thought of using inittab to actually run the app.

What I usually do is create a Bash script in /etc/init.d and create a symlink to it from /etc/rc5.d.  The script I create isn't actually an init script (doesn't have start, stop, restart sections) so I guess it's not technically an init script, but it's still executed when the system boots to runlevel 5.  Move the symlink to /etc/rc3.d if you want it to run in runlevel 3.

I'm not sure which of the two is a better option.

On Thu, Mar 11, 2010 at 10:49 PM, doubleg <[hidden email]> wrote:


kailoi wrote:
>
> You might want to have a read of this.
>
> http://it.toolbox.com/blogs/locutus/exploring-the-etc-directory-inittab-16139
>
> inittab is just a linux control file that defines how various things
> occur during the boot sequence.
>
> I'm not sure what oth means. I've not seen that before. I suspect that
> might be a typo... but 2345 tells inittab to start the program at all
> the standard linux "runlevels" i.e 2, 3, 4, and 5. If you're not that
> familiar with linux this is going to be a little tricky for you. ;)
>
> You can start a program at boot about a million different ways. Try
> googling for "linux start program at boot" and you'll find a million
> different suggestions. Things like putting a script  in /etc/init.d
> and calling it from the various run level dirs is another option.
>
> Chris
>

Thank you Chris for the additional info!  I think I found a million
different ways to do this on Google, and that was part of my problem.  With
all the different "flavors" of Linux, I was having difficulty finding a
method that matched up with Angstrom's file structure.  This inittab method
sure looks like a simple way to go.  Again thank you for the reply.
--
View this message in context: http://old.nabble.com/Application-auto-run-when-angstrom-boots-up-tp27321883p27872811.html
Sent from the Gumstix mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application auto-run when angstrom boots up

doubleg
coderdrone wrote
... create a Bash script in /etc/init.d and create a
symlink to it from /etc/rc5.d.  ... Move the symlink to /etc/rc3.d if you want it to run in
runlevel 3.
I'd like to give this a shot, unfortunately I'm a total newb in the Linux world.  In my searching, I've found lots of instructions like "create a bash script" and "create a symlink", but I haven't gotten my arms around this yet.

I did get the inittab method working, and it seems to be OK.  I wouldn't mind trying the init.d method, but some more detailed instructions on how to do this would help me tremendously (and probably others looking to do the same thing).

Thanks for the reply!

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application auto-run when angstrom boots up

coderdrone
There are many things you can put in a bash script, much of which I'm not even aware of.  However, even a script that only contains the text I am quoting below is enough to just run an app.

As for symlinks, the syntax is: ln -s /path/to/somefile symlinkname, where symlinkname is just a name you want to assign to the symlink itself.  For example, you could create a symlink in your home folder to firefox (assuming firefox is installed in /usr/bin):

coderdrone@localhost:~> ln -s /usr/bin/firefox Firefox

Then you can just run Firefox from your home directory instead of /usr/bin/firefox (let's ignore the possibility of firefox already being in your PATH).

Here is what I do for my software:

Create a bash script in /etc/init.d (with your favorite text editor) containing code similar to below.  Name it MyProgram (for example)

$ vim /etc/init.d/MyProgram
> #!/bin/bash
> #Here are some comments to describe the script
> #
> /path/to/application/appname &

Save this script.  Make it executable.

$ chmod +x /etc/init.d/MyProgram

Verify which runlevel your system boots to by default (probably runlevel 5):

$ cat /etc/inittab |grep default

This should return

id:5:initdefault:

Go into /etc/rc5.d (change 5 to the runlevel returned by the above command) and create a symlink to the /etc/init.d/MyProgram script

$ cd /etc/rc5.d
$ ln -s /etc/init.d/MyProgram S51MyProgram

NOTE:  The 51 part of the symlink is a priority order code.  The init system will execute each of the symlinks in this folder in numerical order, so number your script accordingly.  Get a directory listing (the ls command) and determine where you want your program to run.

Now when you reboot the system, init will execute all the scripts in /etc/rc5.d, including your MyProgram script to execute your software.

Technically, this isn't an actual init script since MyProgram would have to have start, stop, and restart sections, but they're not really needed to just make the app load.  You would need those sections, and symlinks in other rcX.d folders, to get your software to close gracefully on a shut down.  I haven't done that myself.  I just let the kernel kill the app, or exit manually before shutdown... so far anyway.  :)

Hope that helps.

On Fri, Mar 19, 2010 at 11:02 AM, doubleg <[hidden email]> wrote:


coderdrone wrote:
>
> ... create a Bash script in /etc/init.d and create a
> symlink to it from /etc/rc5.d.  ... Move the symlink to /etc/rc3.d if you
> want it to run in
> runlevel 3.
>

I'd like to give this a shot, unfortunately I'm a total newb in the Linux
world.  In my searching, I've found lots of instructions like "create a bash
script" and "create a symlink", but I haven't gotten my arms around this
yet.

I did get the inittab method working, and it seems to be OK.  I wouldn't
mind trying the init.d method, but some more detailed instructions on how to
do this would help me tremendously (and probably others looking to do the
same thing).

Thanks for the reply!


--
View this message in context: http://old.nabble.com/Application-auto-run-when-angstrom-boots-up-tp27321883p27950980.html
Sent from the Gumstix mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application auto-run when angstrom boots up

doubleg
Coderdrone,

This is VERY useful information.  Thank you so much for taking the time to provide the details I needed !!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application auto-run when angstrom boots up

coderdrone
You're welcome.  I'm glad I could help.  If you want to make more of an init script, you could take a look at some of the other scripts in /etc/init.d to see how the formatting goes for them.  The symlinks in the rcX.d directories have either an S or a K (start or kill) that lets init know whether that program or service is supposed to start or stop in that runlevel.  So you could add some cleanup/exit stuff for your program to a "stop" section in the script and symlink a K##MyProgram to it in rc6.d.  Runlevel 6 is restart I believe...  (## is the numbers).

On Sat, Mar 20, 2010 at 10:36 PM, doubleg <[hidden email]> wrote:

Coderdrone,

This is VERY useful information.  Thank you so much for taking the time to
provide the details I needed !!
--
View this message in context: http://old.nabble.com/Application-auto-run-when-angstrom-boots-up-tp27321883p27973349.html
Sent from the Gumstix mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application auto-run when angstrom boots up

doubleg
coderdrone wrote
You're welcome.  I'm glad I could help.  If you want to make more of an init
script, you could ...
Coderdrone,

Thank you again for the additional information!
Loading...