Difference between execv and just running the application?
We have a stub that we run from inittab that executes our process. (Kernel ARM Linux 2.6.25)
When testing the process, it only fails when run from inittab and execv'd. If it's run on the command line, it works fine, every time.
This process makes heavy use of SYS V IPC.
Are there any differences between the two startup methods that I should be aware of?
a source to share
As Matthew mentioned, this is probably a problem with the env variable. Try to dump your env list before calling your program in both cases - through a stub or "manually".
BTW This can help a lot if you could provide more information on why your program worked. Log file? core dump / gdb? return value from execve?
Edit: Other checks: are you sure to pass the exact same parameter list (if there are parameters)?
To answer your question, there is no difference between the two methods. Actually your shell is fork (), and finally call execve () to start your process, feeding it with the options you manually supplied and the environement variables you set in your shell. Btw when you run your program through init, it can start it early on in your computer startup. Are you sure you are ready to use your application well at this point?
a source to share
And if you replace the stub with a shell script? If it works from the command line, it should work from a shell script, and you may know that this is your stub, or the fact that it is in inittab.
Could this be a tty control issue?
Another advantage of the shell script is that you can edit it and strace your program to see where it fails
a source to share