Re: Running an application on startup in embedded linux



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
.



Relevant Pages

  • Re: New iPhone - apps quit on launch
    ... Presumably you have the app itself ... partial request of the daemon and is then quit before it con complete ... can use to quit apps etc. ... I've only just discovered SBsettings, ...
    (uk.comp.sys.mac)
  • Re: difference bet service in win2k & daemons in linux?
    ... IMO arguments to differentiate between daemon and service aren't ... If an an app has ... >something on the screen srvany can't run the application. ...
    (comp.os.linux.misc)
  • Re: difference bet service in win2k & daemons in linux?
    ... IMO arguments to differentiate between daemon and service aren't ... If an an app has ... >something on the screen srvany can't run the application. ...
    (comp.os.linux)
  • Re: mlock(1)
    ... > priveleged users to execute a daemon such that none of the memory the ... Hard to say if it's a policy decision outside the scope of the app. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: Carbon/error
    ... >> What do you think Carbon event handlers will do in a daemon? ... All of this stuff flows through the window ... The reason you'd want to split your app is because whenever the current ... all apps which are connected to the window server get ...
    (comp.sys.mac.programmer.help)