Mailing List Archive

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.

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
Re: x forwarding over SSH [ In reply to ]
Isn't there any buggy process attached to sshd when FireFox dies ?

Le jeudi 23 septembre 2010 à 20:26 -0700, Han a écrit :
> 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
Re: x forwarding over SSH [ In reply to ]
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?

On Thu, Sep 23, 2010 at 22:26, Han <keepsimple@gmail.com> wrote:
> 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

--
" ' 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
Re: x forwarding over SSH [ In reply to ]
On 09/23/2010 11:26 PM, Han wrote:
> 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>
> 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
Re: x forwarding over SSH [ In reply to ]
On Fri, Sep 24, 2010 at 4:38 PM, Alex Smith (K4RNT)
<shadowhunter@gmail.com> wrote:
> 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

>
> On Thu, Sep 23, 2010 at 22:26, Han <keepsimple@gmail.com> wrote:
>> 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
>
> --
> " ' 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
>