Shell – Screen active but no sockets in /var/run/screen

centosgnu-screenshell

I have a game server running on Centos 7 via screen.

I can confirm that the game server is running, I can connect to it with the client, and ps faux gives me this output:

steam    10111  0.0  0.0 127904  3028 ?        Ss   Jul09   0:00 SCREEN
steam    10112  0.0  0.0 115444  3548 pts/2    Ss   Jul09   0:00  \_ /bin/bash
steam    16558  0.0  0.0 113180  2700 pts/2    S+   Jul09   0:00      \_ /bin/bash ./avorionsrv.sh
steam    16564  4.1  5.7 2276908 944748 pts/2  Sl+  Jul09 234:32          \_ ./bin/AvorionServer --gala[...]

However, I can't reattach to that screen session (it was started by the "steam" user):

[steam@atlantis ~]$ screen -r 
There is no screen to be resumed.

And trying to get the list of screens yields "no sockets found"

[steam@atlantis ~]$ screen -ls
No Sockets found in /var/run/screen/S-steam.

The same happens with the root user, and a find in the screen socket directory tells me that there is nothing there.

┌─(/root)──────────────────────────────────────────────────(ROOT@atlantis:pts/0)─┐
└─(11:54:05)──> find /var/run/screen                             <──(Fri 13 Jul)─┘
/var/run/screen
/var/run/screen/S-root
/var/run/screen/S-steam

Any ideas on how to reattach to that screen?

Best Answer

This sounds like your screen socket files got deleted out from under screen. You can trigger screen to recreate them like so by send the SIGCHLD signal to them using the kill command:

$ kill -CHLD 30860
$ ls /var/run/screen/S-username/
30860.pts-4.localhost

Where the PID, 30860, is the PID of screen. There are additional methods highlighted in the FAQ titled: archived Gentoo Wiki FAQ.

References