[BusyBox] starting script from inittab

Erik Andersen andersen at codepoet.org
Fri Apr 25 17:44:39 UTC 2003


On Fri Apr 25, 2003 at 06:12:28PM +0200, Matthias Fuchs wrote:
> Hi,
> 
> I am using this entry in busybox' inittab to start a script:
> 
> ::once:/root/start
> 
> The script itself start some applications, does some sleep, starts some more
> application and exits:
> 
> 	#!/bin/sh
> 	...
> 	app1 &
> 	app2 &
> 	sleep 2
> 	app3 &
> 
> When app3 is started, the scipt exits and all started apps are killed. Why?
> And what can I do to save them from being killed?

When you run apps from a shell script with '&', the are processes
are run in the background, but are still child processes of the
script.  When the script, which is the parent processes, exits,
the kernel will kill all the child processes.

You want to use the 'start-stop-daemon' applet to launch these
apps and fully disassociate them from your script,

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--


More information about the busybox mailing list