Discussion:
x forwarding over SSH
(too old to reply)
Han
2010-09-24 03:26:28 UTC
Permalink
Hi,

I am using SSH to do X forwarding and saw an interesting problem: for
some applications, even when I closed the application itself, the SSH
session is still not closed. For other applications, SSH sessions
closed whenever I closed the application.

For example, if I do:

ssh -X <host> xclock

then I close the xclock app, the ssh session exits.

but if I do:

ssh -X <host> firefox

then I close the firefox app, the ssh session does not exit.

In the latter case, I can see the corresponding sshd process is still
running at <host>. Is such behavior caused by the application? any
insights are appreciated.

my SSH version is:
OpenSSH_5.1p1 Debian-6ubuntu2, OpenSSL 0.9.8g

thanks
Han
Pierre Jaury
2010-09-24 21:04:31 UTC
Permalink
Isn't there any buggy process attached to sshd when FireFox dies ?
Post by Han
Hi,
I am using SSH to do X forwarding and saw an interesting problem: for
some applications, even when I closed the application itself, the SSH
session is still not closed. For other applications, SSH sessions
closed whenever I closed the application.
ssh -X <host> xclock
then I close the xclock app, the ssh session exits.
ssh -X <host> firefox
then I close the firefox app, the ssh session does not exit.
In the latter case, I can see the corresponding sshd process is still
running at <host>. Is such behavior caused by the application? any
insights are appreciated.
OpenSSH_5.1p1 Debian-6ubuntu2, OpenSSL 0.9.8g
thanks
Han
Alex Smith (K4RNT)
2010-09-24 23:38:49 UTC
Permalink
I notice that on Windows, Firefox lingers for a few moments after the
window is closed, presumably for garbage collection until the process
finally dies off.

Perhaps this is what's happening with you? Does it happen with other
applications, or just with Firefox?
Hi,
I am using SSH to do X forwarding and saw an interesting problem:  for
some applications, even when I closed the application itself, the SSH
session is still not closed.  For other applications, SSH sessions
closed whenever I closed the application.
ssh -X <host> xclock
then I close the xclock app, the ssh session exits.
ssh -X <host> firefox
then I close the firefox app,  the ssh session does not exit.
In the latter case, I can see the corresponding sshd process is still
running at <host>.  Is such behavior caused by the application?  any
insights are appreciated.
OpenSSH_5.1p1 Debian-6ubuntu2, OpenSSL 0.9.8g
--
" ' With the first link, the chain is forged. The first speech
censured, the first thought forbidden, the first freedom denied,
chains us all irrevocably.' Those words were uttered by Judge Aaron
Satie as wisdom and warning... The first time any man's freedom is
trodden on we’re all damaged." - Jean-Luc Picard, quoting Judge Aaron
Satie, Star Trek: TNG episode "The Drumhead"
- Alex Smith (K4RNT)
- Murfreesboro, Tennessee USA
Han
2010-09-25 03:33:07 UTC
Permalink
Post by Pierre Jaury
Isn't there any buggy process attached to sshd when FireFox dies ?
It seems there are 4 processes running on the remote host when I
started firefox via ssh -X :

han 1939 1895 0 20:28 ? 00:00:00 sshd: ***@notty
han 1940 1939 0 20:28 ? 00:00:00 /bin/sh
/usr/lib/firefox-3.6.9/firefox
han 1947 1940 0 20:28 ? 00:00:00 /bin/sh
/usr/lib/firefox-3.6.9/run-mozilla.sh
/usr/lib/firefox-3.6.9/firefox-bin
han 1951 1947 6 20:28 ? 00:00:09
/usr/lib/firefox-3.6.9/firefox-bin

after I closed the firefox window, there is only one process left on
the remote host:

han 1939 1895 0 20:28 ? 00:00:00 sshd: ***@notty

I am wondering why this one did not exit.

Han
Post by Pierre Jaury
----- Reply message -----
Date : ven., sept. 24, 2010 05:26
Objet : x forwarding over SSH
Hi,
I am using SSH to do X forwarding and saw an interesting problem:  for
some applications, even when I closed the application itself, the SSH
session is still not closed.  For other applications, SSH sessions
closed whenever I closed the application.
ssh -X <host> xclock
then I close the xclock app, the ssh session exits.
ssh -X <host> firefox
then I close the firefox app,  the ssh session does not exit.
In the latter case, I can see the corresponding sshd process is still
running at <host>.  Is such behavior caused by the application?  any
insights are appreciated.
OpenSSH_5.1p1 Debian-6ubuntu2, OpenSSL 0.9.8g
thanks
Han
John Bailey
2010-09-25 01:16:22 UTC
Permalink
Post by Han
I am using SSH to do X forwarding and saw an interesting problem: for
some applications, even when I closed the application itself, the SSH
session is still not closed. For other applications, SSH sessions
closed whenever I closed the application.
<snip>
Post by Han
In the latter case, I can see the corresponding sshd process is still
running at <host>. Is such behavior caused by the application? any
insights are appreciated.
Yes, actually, this is Firefox. When you run "firefox", you're actually running
a wrapper script that does several things before launching the actual
firefox-bin binary. I've seen quite frequently that Firefox doesn't truly "die"
when you close it (Thunderbird, Icedove, and Iceweasel all exhibit this
behavior). You likely still have processes running that are holding your ssh
session(s) open.

John
Han
2010-09-26 05:50:45 UTC
Permalink
On Fri, Sep 24, 2010 at 4:38 PM, Alex Smith (K4RNT)
Post by Alex Smith (K4RNT)
I notice that on Windows, Firefox lingers for a few moments after the
window is closed, presumably for garbage collection until the process
finally dies off.
Perhaps this is what's happening with you? Does it happen with other
applications, or just with Firefox?
I tried Firefox and Prism, both has this issue.
I also tried google-chrome, no such issue.

so seems to be specific to Firefox / Mozilla.

Han
Post by Alex Smith (K4RNT)
Hi,
I am using SSH to do X forwarding and saw an interesting problem:  for
some applications, even when I closed the application itself, the SSH
session is still not closed.  For other applications, SSH sessions
closed whenever I closed the application.
ssh -X <host> xclock
then I close the xclock app, the ssh session exits.
ssh -X <host> firefox
then I close the firefox app,  the ssh session does not exit.
In the latter case, I can see the corresponding sshd process is still
running at <host>.  Is such behavior caused by the application?  any
insights are appreciated.
OpenSSH_5.1p1 Debian-6ubuntu2, OpenSSL 0.9.8g
--
" ' With the first link, the chain is forged. The first speech
censured, the first thought forbidden, the first freedom denied,
chains us all irrevocably.' Those words were uttered by Judge Aaron
Satie as wisdom and warning... The first time any man's freedom is
trodden on we’re all damaged." - Jean-Luc Picard, quoting Judge Aaron
Satie, Star Trek: TNG episode "The Drumhead"
- Alex Smith (K4RNT)
- Murfreesboro, Tennessee USA
Loading...