running an X windows process in background through ssh

running an X windows process in background through ssh

Post by Alex Gerdema » Fri, 11 Jun 2004 03:21:33



I'd like to write a shell script in csh (or something else if
necessary) that ssh's to a remote machine, runs a X Windows
application, leaves that application running, and then gives me the
terminal back on my local machine.  Best I've been able to do is:

ssh -X my_server "xApp &"

The problem is that ssh logs out immediately and kills the X11
forwarding.

I've also tried:

ssh -X my_server xApp &

but then the password prompt doesn't work properly because the next
line in the script is sent as the password.

Any suggestions?

Thanks,

Alex Gerdemann

 
 
 

running an X windows process in background through ssh

Post by Kenny McCorma » Fri, 11 Jun 2004 04:01:02




>I'd like to write a shell script in csh (or something else if
>necessary) that ssh's to a remote machine, runs a X Windows
>application, leaves that application running, and then gives me the
>terminal back on my local machine.  Best I've been able to do is:

>ssh -X my_server "xApp &"

>The problem is that ssh logs out immediately and kills the X11
>forwarding.

>I've also tried:

>ssh -X my_server xApp &

>but then the password prompt doesn't work properly because the next
>line in the script is sent as the password.

>Any suggestions?

I think you are looking for the "-f" option.

 
 
 

1. Killing csh background process **AND** any unfinished processes (fg and background) it started

Hi,

Does anybody know of a solution for killing a csh background process
**AND** any unfinished processes (fg and background) it started.

I know you guys think tcsh sucks but translating the csh code to bash is
not trivial task because of it's large volume of the case I have at
hand.

I should mention that when the csh script is started in the foreground
on a terminal and I do a ^C it behaves excellent in that it exits and
all the processes it started exit.

Things I considered (and didn't work for me):

   * Use the -q option of csh and kill with a signal: QUIT (3). Only
     kills the shell but not a process started by the shell in the
     foreground (actually another csh).
   * Use the csh onintr command and when interrupt time arrives the
     processes will be killed with signal INT (2) before the script
     exits. The same for the processes started. With the many scripts
     this becomes unfeasible. I'm hoping to add a line or two to each
     script, max.
   * Use the tcsh hup command and kill with a signal: HUP (1). Again,
     the process started by tcsh in the fg doesn't finish.
   * Set limits on cpu usage. Ugly and insufficient because a process
     might not take cpu but still get left behind.

After this mess is solved, I'll try to hook this all up to Python;-) And
never code in csh again?

Thanks for your time,
Jurgen

2. oracle 7.2 slow and to much wait in cpu

3. How to background a remote process thru rsh??

4. [OT} Dr Square revealed

5. Can't run X thru ssh

6. a bunch of dum questions (i think)

7. running ssh in a background from a for loop

8. Ugly world...?

9. background process runs and output comes to terminal in 4.3.3

10. How Do U run a Background Process ?

11. Apache, background process to find out if it's still running

12. Run a background process in cgi script.

13. HOW TO RE-DIRECT THE STDIN/STDOUT FOR A PROCESS RUNNING IN THE BACKGROUND