You are not logged in.
I'm trying to create a wrapper script for certain apps.
I need the script to keep running so I can execute commands before launching the application and after it exits. So I am not using 'exec' and I don't background the command that I want to run, and this works for most commands as intended.
However there is a specific application that causes the script to exit immediately, and keeps running as an orphan process.
I tried this in my script:
$command_to_run &
pid=$!
wait $pid
But it still doesn't work.
If I echo the $pid and check with ps later, I can see that the command is running with a *different* pid than the one reported in the script.
I suppose that the application exits early and launches itself in a different process?
Is there a way to workaround such behaviour?
Thanks
Last edited by manmachine (2010-12-13 11:22:25)
Offline
Keeping things practical and simple is never a bad idea...turns out said application uses its own small binary launcher, by bypassing it and calling the main binary directly the script just works. Marking as solved.
Offline