[ELDK] Starting an application at boot time using different tty<x>
Detlev Zundel
dzu at denx.de
Mon Nov 30 18:56:00 CET 2009
Hi Jonathan,
[the line length in yoiur posting seriously exceeds the recommended 80
characters]
> I have two questions concerning:
> 1. Starting a script at boot time
> 2. Displaying system messages on tty<x> and the output of my applications on tty<z>
>
> 1. Starting a script at boot time
>
> I have to start two applications (a microbrowser and a webserver) at
> boot time. I wrote a script called start.sh which call these two
> executables. I added this script at the end of inittab:
> "::once:/start.sh". The two applications started but I noticed a drop
> in the performances compared to starting the applications manually. Do
> you know why ? Are any priorities set low when starting from inittab ?
I would be surprised if this is the case. Much more probable is that
the devices presented to the application are not what the latter
expects. Try to use 'strace' to find discrepancies between a "normal"
run and a run from the inittab like you do. Moreover I would recommend
that a "once" action from inittab is probably not a good thing for a
mission critial application, i.e. what do you do if the application
crashes, will your device be unusable then?
> Is "inittab" the right place to start my "start.sh" script or is there
> a standard place to start it from ?
There are so many different approaches to such a problem, that there is
no "standard" way. Just look at all the possibilities, i.e. using sysv-init,
upstart, runit, monit, etc. The choice depends on your system design
(and is thus somewhat OT on this mailing list, as Wolfgang indicated).
> 2. Displaying system message on tty<x> and output of my applications on tty<z>
>
> When I start my system a microbrowser directly writes into the
> framebuffer and displays my html pages. But the system also writes to
> this framebuffer (for example when connecting an USB stick, or when
> the reboot of the system is done, or when an error occured,
> etc...). But I do not want the user to see the linux system
> messages. So I would like to separate the output of my applications
> and the system messages. But how do I tell the system to put its
> messages to tty1 and not tty0 ? How can I switch automatically between
> the tty0 view and the tty1 view ? (I have no ALT + F1 keys on my
> embedded hardware, so I must find another way to switch).
As Wolfgang indicated, use a suitable "console=" command line and check
the man page for chvt(1). Note that I did not use it under such
circumstances, but it looks like what you are searching for...
Cheers
Detlev
--
Those who deny freedom to others deserve it not for themselves.
-- Abraham Lincoln
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
More information about the eldk
mailing list