This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: SSH and reattaching screen


I realize this is a really old thread, but I'm having the same problem now
with the latest version of screen (4.0.3-5) and cygwin (uname -srv =
CYGWIN_NT-5.1 1.7.2(0.225/5/3) 2010-03-24 21:12), and this is the first
google result, so I wanna post this somewhere that people will find it.

screen -DRR didn't work for me.  Neither did turning on the nonblock screen
option, which I saw in another forum.  I don't have a solution to the
problem, but a work-around.  After closing SSH, open screen sessions lock
up, 'screen -wipe' locks up, and 'screen -xRR' locks up.  If you send a
SIGHUP to all of the screen processes, it'll detach every screen session,
but the screen server will still be running, and will allow you to reattach
now.  So, I have a bash script that I run when this happens like this:
-------------------------
#!/bin/sh
# Send SIGHUP to each screen to force it to let go and let the server
recover
ps -as | grep screen | cut -c4-7 | xargs kill -1
# Reattach
screen -xRR
-------------------------

-Isaiah




Derek Schrock wrote:
> 
> alias sshhs='ssh -t domain.com '\''screen -DRR session || screen -S
> session bash '\'''
> 
> -DRR seemed to fix the problem
> I don't like using -DRR because I don't really know what it means "Do
> whatever it takes."  Is it creating some kinda memory leak that -Dr
> wasn't?
> We'll see how long DRR works
> 
> On Thu, Aug 21, 2008 at 4:11 PM, Andrew Schulman
> <schulman.andrew@epamail.epa.gov> wrote:
>>> Is there a known problem with Cygwin's SSH and trying to reattach to
>>> screen sessions?  This seems to be a random occurrence but while
>>> trying to reattach to a screen session screen will hang indefinitely.
>>> I'm using ssh on a Mac OS X 10.5.4 system to ssh into a Windows 2003
>>> Cygwin installation.  Using a bash alias ( alias sshhs='ssh -t
>>> domain.com '\''screen -xDr session || screen -S session bash '\''' )
>>> to connect and try to reattach to a session named session and if that
>>> fails create a new screen session called session.  I've seen this hang
>>> occur from accedently closing a Terminal window to telling ssh to
>>> close connection ( etner ~  . ).  It is not a timed based problem
>>> because I've let sessions sit for days that I could reattach to and
>>> sessions that were disconnected for a second that would hang.  Also
>>> something to take note, options like -list or -wipe will also hang
>>> screen.  So for instance if screen is hanging I can ssh in normally
>>> and try to do screen -list or screen -wipe and that screen will hang.
>>> The solution to the problem currently is to ssh or Remote Desktop into
>>> the machine and kill the hanging screen PID.  Is there something
>>> fundmently wrong that I'm doing with ssh or screen that's causing this
>>> in Cygwin? Thanks.
>>
>> Hi Derek.  I haven't heard of this particular problem before, where the
>> reattach
>> hangs.  In the past screen had frequent problems reattaching in Cygwin,
>> but in
>> all the cases I'm aware of the session was unreachable, i.e. it was
>> listed but
>> the socket was dead so screen wouldn't let you reattach at all.
>>
>> The reattachment problems are mostly solved in the current version of
>> screen in
>> Cygwin AFAIK.  I use it every day and I have only occasional problems
>> reattaching-- not frequent and nothing I've ever been able to pin down.
>> However,
>> I'm using a console window, not logging in via ssh.  Not sure how much
>> difference that makes.
>>
>> Last year IIRC, one person reported that he couldn't reattach, and he was
>> also
>> using ssh.  In his case, I believe that at least part of the problem had
>> to do
>> with bad permissions on the socket files, in /tmp/uscreens.
>>
>> HTH,
>> Andrew.
>>
>>
>> --
>> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>> Problem reports:       http://cygwin.com/problems.html
>> Documentation:         http://cygwin.com/docs.html
>> FAQ:                   http://cygwin.com/faq/
>>
>>
> 
> 
> 
> -- 
> Derek Schrock
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/SSH-and-reattaching-screen-tp19071658p28075375.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]