7

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?

2
  • screens by default are managed per user. The easiest way to reattach that screen is assuming the user steam identity. Commented Jul 13, 2018 at 12:09
  • @RuiFRibeiro that was my first try, I had started screen from the "steam" user, and of course I tried reattaching to it from the same user.
    – Fanfurlio
    Commented Jul 13, 2018 at 12:29

1 Answer 1

3

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

2
  • 1
    Worked perfectly, thanks! Just a side note, how did the socket files get deleted? It's the first time that happens to me, and I've been using screen for at least ten years now, almost always with long (week/month long) processes.
    – Fanfurlio
    Commented Jul 14, 2018 at 17:50
  • @fanfurlio - terrific, glad it worked out.
    – slm
    Commented Jul 14, 2018 at 17:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .