Bug 184090

Summary: screen -r finds multiple sessions, so I cannot reconnect
Product: Red Hat Enterprise Linux 4 Reporter: Rainer Traut <rainer.traut>
Component: screenAssignee: Petr Rockai <prockai>
Status: CLOSED NOTABUG QA Contact: Brock Organ <borgan>
Severity: low Docs Contact:
Priority: medium    
Version: 4.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-03-06 08:02:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rainer Traut 2006-03-06 07:56:04 UTC
Description of problem:
screen -r finds multiple sessions, so I cannot reconnect

for example:
[cod@server ~]$ screen -ls
There are screens on:
        9643.cod        (Detached)
        9729.cod2       (Detached)
2 Sockets in /tmp/uscreens/S-cod.

[cod@server ~]$ screen -r cod
There are several suitable screens on:
        9643.cod        (Detached)
        9729.cod2       (Detached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.
[cod@server ~]$ screen -r cod2
...
Sending heartbeat to cod2master.activision.com
Sending heartbeat to cod2master.activision.com
Sending heartbeat to cod2master.activision.com
Sending heartbeat to cod2master.activision.com
Sending heartbeat to cod2master.activision.com 

Version-Release number of selected component (if applicable):
screen-4.0.2-5

How reproducible:
always if one screen name is a substring of another

Steps to Reproduce:
1.[cod@server ~]$ screen -ls
There are screens on:
        9643.cod        (Detached)
        9729.cod2       (Detached)

2.[cod@server ~]$ screen -r cod
There are several suitable screens on:
        9643.cod        (Detached)
        9729.cod2       (Detached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.

3.[cod@server ~]$ screen -r cod2
...
Sending heartbeat to cod2master.activision.com
Sending heartbeat to cod2master.activision.com
Sending heartbeat to cod2master.activision.com
Sending heartbeat to cod2master.activision.com
Sending heartbeat to cod2master.activision.com 


  
Actual results:
cannot reconnect, though the name is right.

Expected results:
can reconnect

Additional info:
Seems screen finds two sessions, but should not do so.

Comment 1 Petr Rockai 2006-03-06 08:02:35 UTC
Either name your sessions in a manner that no one is substring of other (cod1, 
cod2, ...) or use screen -r 96 or screen -r 97 in your case above (or whole pid 
or pid.name or another unique string). Equally, screen -r 9643.cod or 9643 
would work as well as 9729.cod2 or 9729...