Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I fix 'WriteMessage: Bad file descriptor' of screen -r name?

Tags:

gnu-screen

When I try to resume a screen session with

$ screen -r name

I get

WriteMessage: Bad file descriptor

How can I fix that? (Ideally being able to resume the screen, but at least remove it if resuming is not possible)

The problem why it occurs might be that the SSH connection was interrupted.

like image 839
Martin Thoma Avatar asked Dec 12 '17 09:12

Martin Thoma


1 Answers

This worked for me:

  1. Find the process's pid by running screen -R
  2. Use screen -r <pid> instead of screen -r <name>

If the screen didn't detach from previous ssh session, you might also need to kill dead sshd process.

like image 87
LouYu Avatar answered Sep 21 '22 13:09

LouYu