cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jcjets
Level 3

Execute process and stdin and stdout

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?
Labels (1)
0 Kudos

(5) Replies
Eyal_Goren
Level 6

What if in the Execute process you set the 'Wait for completion' to false ?
0 Kudos
jcjets
Level 3

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.
0 Kudos
enanrum
Level 9

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
0 Kudos
jcjets
Level 3

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.
0 Kudos
enanrum
Level 9

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!
0 Kudos