[BusyBox] how to automatically start an app at boot time?

Robert P. J. Day rpjday at mindspring.com
Mon Jan 19 12:16:45 UTC 2004



On Sun, 18 Jan 2004, Steve Dover wrote:

> Robert P. J. Day wrote:
> >   currently, a couple of us are grappling with trying to start an app at
> > boot time.  we're using 1.00-pre5, with
> > 
> >   /linuxrc -> bin/busybox
> > 
> > and a simple inittab with a single shell being started with the "askfirst"
> > action field.
> > 
> >   our first obvious attempt was to check out /etc/init.d/rcS, and at the
> > bottom, there is a conditional invocation of /sbin/setup.sh.  so we just
> > added the invocation of our application to /sbin/setup.sh.
> > 
> >   sadly, our app doesn't get invoked at boot time, but it runs just fine
> > if we start it manually once we get a shell prompt.
> > 
> >   can someone explain the ideal method for starting the main system
> > app at boot time?  we need to be able to set a few environment vars
> > before actually starting it.  so what's the recipe?  thanks.
> > 
> > rday
> 
> In your inittab, have an entry that kicks off rcS :
> 
> ::sysinit:/etc/init.d/rcS
> 
> Have that script do your setup stuff such as mounting /proc, etc.
> and have it start any background daemons that you want running.

we're already doing that.  we have that line in our /etc/inittab file, and
at the bottom of /etc/init.d/rcS, we found the original lines:

	if [ -x /sbin/setup.sh ]
	then
  		/sbin/setup.sh
	fi

so we added the invocation of our app to the /sbin/setup.sh file.  the
invocation involves setting some env vars, then running the program. print
statements show that the boot time execution is, in fact, getting there,
but the app is not invoked (or, at least, if it's invoked, it stops
immediately).

if, however, we wait until we get a shell prompt, we can run the app fine
from the command line.  i'm wondering if there's something critical that's
missing or hasn't been initialized yet earlier in the boot process that
prevents the app from starting properly.

i'm fairly familiar with the linux boot sequence, but not that familiar
with how busybox might change some of that, so we're still a little
puzzled.

rday
 



More information about the busybox mailing list