PDA

View Full Version : Execute process and stdin and stdout



jcjets
04-28-2006, 04:12 PM
Has anyone been able to solve the problem of executing a shell script from the Execute Process wizard bean? I launch the script and within the script I start a process, the script never exits since the ExecuteProcess bean sits waiting for stdin and stdout to post an exit code and it never does.

Unless I kill the process that I started with the script IShield sits forever. I tried writting a custom bean to do this with no success.

Has anyone else solved this problem?

Eyal Goren
04-29-2006, 07:18 AM
What if in the Execute process you set the 'Wait for completion' to false ?

jcjets
05-01-2006, 07:52 PM
That's not an option as I have to wait for the script to complete before I continue with the install. I cannot use a wait object either as slower machines can take who knows how long to complete the script.

enanrum
05-02-2006, 12:24 PM
I maybe as confused as Eyal!

You say - "I start a process, the script never exits since the ExecuteProcess bean sits waiting for stdin and stdout to post an exit code and it never does."

It is not the 'ExecuteProcess' that prevents the script from exiting - it is the script itself!

You say you can't set the 'Wait Completion' to false because you have to wait for the script to finish - but it never does!

Very confusing!

Is the script suppose to exit?

Do you have an 'exit 0' in your script?

Are you kicking off a process that will continue to run from within the script - if so are you running the process in the background using '&' and the script should finish and return some type of completion to the ExecuteProcess!

Regards,
Tom

jcjets
05-02-2006, 12:48 PM
Here is what is happening. When I use the Execute Process bean it is a java process that starts up and reads the STDIN, STDOUT, and the STDERR buffers for exit codes.

I launch a csh script from the execute process bean that starts a database server. The database server is started, but the execute process bean never returns. I was told that this is because the script launched another process and as long as that process is running, nothing is posted to the STDIN, STDOUT, or STDERR buffers until that process finishes. If I kill -9 the database server ID then the execute process bean returns.

Yes I have tried starting the database server with the & to put it in the background, I also tried using the nohup command to start it as well. IShield never returns though and the install sits there until I manually stop the DB server. I also put an exit at the end of the script...no luck.

enanrum
05-02-2006, 02:04 PM
If you are starting a server of any kind through the script then you have to set the 'Wait For Completion ' to 'false' because yes, that process will linger on until the server is killed - which is what you are doing to get your install to continue!