[BusyBox] Running app from inittab script vs /bin/sh

Jeff Angielski jeff at theptrgroup.com
Tue Dec 9 03:23:01 UTC 2003


Hi Wolfgang,

Thanks for all the help.  My comments are below.

On Mon, 2003-12-08 at 20:07, Wolfgang Denk wrote:
> In message <1070930105.5181.14.camel at localhost.localdomain> you wrote:
> > 
> > I have an application that runs fine when I run it from the shell but
> > turns into zombies when I run it from a shell started from inittab.
> > 
> > Works:
> > 
> > # /home/myapp
> 
> Does it actually work that way in the ramdisk environment, or did you
> only test it in a NFS-root world?

The application does work in the standalone configuration when run from
the command line shell.

An interesting thing is that the application works from an inittab
spawned shell when run on the NFS system, just not the standalone
system.

When it does not work from the inittab script, I can see that it
actually starts execution because I see some debug messages that I
added.  And I see that the shm is working because they are passing data
between the threads.

> Are you sure that all needed libraries have been added to the ramdisk
> image?

The ldd shows that no libraries are required but it still could be doing
dlopen()s like you mentioned below.  

> 
> > In trying to figure out what is going on, when I try to give it a
> > terminal by invoking it as:
> > 	
> > 	/bin/sh /home/myapp
> > 
> > I get the following error message (which is even more suspect):
> > 	
> > 	.ELF...: not found
> 
> This is not suspect, but what happens if you try to run an ELF binary
> file as a shell script. Don't do it, then.

This makes total sense now that you pointed it out.

> > FWIW, the application spawns a bunch of threads and uses some shared
> > memory IPC constructs (semaphores, message queues, etc.).  It was built
> > statically so there are no dynamic library issues going on.
> 
> Don't bet on this. Some libraries use dlopen()  to  dynamically  load
> additional stuff even if linked statically.

Good point.

> 
> > Has anybody else seen this problem?
> 
> Likely problems: (1) a bug in your application, (2) missing libraries
> and/or other relevant files, (3) missing shm  support,  (4)  shm  not
> mounted, ...

The big question is why does it work one way and not the other for the
same filesystem?

> 
> 
> Best regards,
> 
> Wolfgang Denk




More information about the busybox mailing list