Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have GNU screen running in LXC container, thus having private PID namespace. I'm trying to attach to that screen from "outside" the namespace. Both screens share filesystem, thus are able to access same socket. "External" screen -ls lists session properly, but attempt to attach with screen -x fails, with "Attach attempt with bad pid(XXX)!" message on original screen running inside lxc container. "External" attacher screen waits for 15 seconds and exits with "Suddenly the Dungeon collapses!! - You die..." message and 1 as errorcode.

"External" attacher is able to remotely detach screen with screen -d but still have 15sec timeout and 'Collapse' error. "External" attacher is able to execute commands with screen -X with no problems. However screen -Q passes command into running screen then hang and wait for Ctrl+C, leaving dead socket suffixed -queryA in /var/run/screen/.

That is natural that "internal" screen cannot see "external" one as they doesn't share pid namespace. Is that possible to turn off the PID check in screen? Why do we need that check while attaching to screen anyway? Isn't access to socket enough for screens to communicate properly with each other?

Update: I've submitted request to screen-devel maillist via bug report #35324.

share|improve this question
    
Could it be that the container sees outside processes as having PID == 1? The source code of screen explicitly rejects PID 1 for unknown reasons. –  grawity Jan 17 '12 at 11:48
    
Inside LXC container only internal processes are seen. Among internal processes there is process with PID 1 but it is process that is being launched via lxc and the one that spawns "internal" screen later. The internal screen gets correct PID of attacher screen, it just cannot access it, due to different pid namespace. –  myroslav Jan 17 '12 at 11:51
    
"Inside LXC container only internal processes are seen" - That could be one cause. But Unix socket connections automatically send the client's PID to the server, that's what I was asking about. –  grawity Jan 17 '12 at 11:53
    
What is the problem with inability to access process with "external" pid? As I've written in question itself, screen -X successfully passes commands into screen. –  myroslav Jan 17 '12 at 11:55
    
... You'll have to ask screen developers about that. I only found the check, but it wasn't written why the check was added. –  grawity Jan 17 '12 at 12:27
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.