Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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"
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. 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. I am using tightvncserver to view the server desktop.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

gnome-terminal running locally uses a background "factory" server which owns the actual terminal windows; the gnome-terminal command itself exits after contacting the server over DBus and telling it to launch a window. When running remotely, it does not have the ability to communicate with a factory server, so it sets up the window itself and must continue running until that window is closed.

If you put the command in the background with & you will get the effect you want regardless of remote or local (or use of --disable-factory which would cause the local ones to behave like the remote ones). You probably want a final wait command in the script in that case.

share|improve this answer
    
It seems that even the & for backgrounding is not needed if VNC is used to run the scripts. The & helps if you are using an SSH console on the client to run the remote script. –  H2ONaCl Apr 23 '12 at 10:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.