Re: Running an application on startup in embedded linux
- From: Mike McGinn <mikemcginn@xxxxxxxxxxxxx>
- Date: Tue, 20 Nov 2007 14:58:03 -0000
On 2007-11-20, Trastabuga <lispercat@xxxxxxxxx> wrote:
On Nov 19, 7:40 pm, Neil Cherry <n...@xxxxxxxxxxx> wrote:
In comp.os.linux.development.system, you wrote:
I need to run an application when the linux boots up which provides
the UPnP functionality of the box.
During development it was easy to boot the system, login as a root and
start the app from command line.
Moving to the production I started to think what would be the best
approach to start the app during booting.
1) Autologin to linux and run it from .bash_profile. This way seems
very flexible to me because I can always connect to the box via the
serial port and kill the app, modify it and run again. The problem is
I don't really know how to implement autologin on the sytem we have.
Should it be some special app for this or it's possible to do just
with /etc/inittab?
2) Make a daemon out of the app. This way autologin is not neccessary
and I still can connect to the system and have control over it. I'll
have no way to print out to the standard output, that's the minus.
3) Run the app straight from /etc/inittab. This is the easiest way,
but in this case the app will block the bash and it's going to be hard
to have a control over the system because now the app is blocking out
the bash.
I need an advise which way to go and maybe what to read to know more
about the way applications in embedded systems should work.
Thank you, Neil. To use a script like this does my app have to be a
daemon? If it's so, I'll have to convert it from a plain app to a
daemon. Also, how do you debug a daemon? Can you use a printf to print
to a standard output from it?
Andrew
by definition a daemon has no controlling terminal --- so obviously
printf() is out for that. I suggest you start by coding your app as a
regular program to make sure the functionality of the program is
working. Once you get this working, you can alter it so it runs as a
deamon. Strongly suggest you read up on daemon initialization too. W.
Richard Stevens "Advanced Programming in a Unix Environment" would be a
good place to start.
--
Mike McGinn
"more kidneys than eyes"
Registered Linux User 377849
.
- References:
- Running an application on startup in embedded linux
- From: Trastabuga
- Re: Running an application on startup in embedded linux
- From: Neil Cherry
- Re: Running an application on startup in embedded linux
- From: Trastabuga
- Running an application on startup in embedded linux
- Prev by Date: Re: Running an application on startup in embedded linux
- Next by Date: Re: module license taints kernel.
- Previous by thread: Re: Running an application on startup in embedded linux
- Next by thread: Question on usb
- Index(es):
Relevant Pages
|