Why does this script not open parallel gnome-terminals on a server?

Posted by broiyan on Ask Ubuntu See other posts from Ask Ubuntu or by broiyan
Published on 2012-04-09T09:11:22Z Indexed on 2012/04/09 11:49 UTC
Read the original article Hit count: 351

Filed under:
|
|

Why am I not able to have parallel gnome-terminals on my server while I can on my client.

Here is a test that illustrates the problem.

#!/bin/bash
# this is the parent script
gnome-terminal --command "./left.sh"
sleep 10
gnome-terminal --command "./right.sh"

#!/bin/bash
echo "this is the left script"
read -p "press any key to close this terminal" key

#!/bin/bash
echo "this is the right script"
read -p "press any key to close this terminal" key

When I run this on a regular ubuntu desktop (maverick) I see two terminals after 10 seconds. When I run this on a maverick server at a server farm, the second window does not appear until after I close the first one and wait 10 seconds. I am using tightvncserver to view the server desktop.

(I could have simplified a bit more. The 10 second sleep is extraneous to the problem. In my real world application I need the first terminal to do some real work before starting the second. The problem probably still exists even if there is no sleep.)

© Ask Ubuntu or respective owner

Related posts about server

Related posts about gnome-terminal