Run multiples jobs in background mod

Hi,

I have a problem runnig from script two diferents process in background mod. Is there a limitation to do this?

For example

echo "Running process one:"
./ProcessOne &
echo "Running process two:"
./ProcessTwo &
echo "The process are runnig. Bye"

The problem is that the execution of ProcessOne crash when starts process of ProcessTwo. Is there any way to do this?

Thanks!!!

NOTE: I need to run ProcessOne and ProcessTwo paralelly in background mod.

What do you mean crashed(i.e. messages logged)??

You can also try it like this:

echo "Running process one:"
nohup ./ProcessOne >> ${log_file} &
echo "Running process two:"
nohup ./ProcessTwo >> ${log_file} &
echo "The process are runnig. Bye"

Same problem. When i say crash, i mean the first process "stop" when the second process is sending to background.

---------- Post updated at 03:57 PM ---------- Previous update was at 03:41 PM ----------

Look this, the complete script:

echo "Launching first process.."
ProcessOne > /dev/null 2> /dev/null &
jobs -l 
#I need time to the process one do some things, 20 seconds is a good time
echo "Sleeping 20 seconds" 
sleep 20
echo "Launching second process.. "
ProcessTwo /dev/null 2> /dev/null &
jobs -l
echo "Finished."

The processTwo comunicates with processOne. But this is the output console

Launching first process..
[1] + 536870930  Running                 <command unknown>
Sleeping 20 seconds
Launching second process..
[2] + 268435475  Running                 <command unknown>
[1] - 536870930  Running                 <command unknown>
Finished.

For some reason the processOne doesnt execute well. If i do this with two consoles manually in foreground, the program executes well.

I hope you can help me.

Sorry for my english, is bad.

What is the program?

If it's an interactive thing which expects a terminal, it will get frozen when something else takes control of the terminal.

Ok, I see both jobs are running:

How? Examples......

I don't understand, What exactly do you mean?
Does 'P1' not respond to communication from 'P2'?

Exaccly. P1 and P2 are not an interactive program. They comunicates with messages with TCP, but i think it is not the question. The problem is when P2 starts, it say "connection time out" becouse P1 doesnt respond.

I repeat, if i do manually with two terminals, the process P1 and P2 work correctly.

Please answer this question.

Ok, Post code for these two scripts that you run in background that should talk to each other because one or the other does not like running in the background.