5

I ssh to a remote computer, and create a screen session there. Then I lose the internet connection. When I ssh again to the computer, I want to see if the created screen session is still there, so I run

$ screen -l

but it seems to me that it doesn't list screen sessions, but create a new session, so I ctrl-d and terminate it.

[screen is terminating]

Then I run

$ screen -ls
No Sockets found in /var/run/screen/S-tim

Does it mean that losing internet connection will kill any attached screen session?

Note: I tried to reproduce the above scenario except screen -l, but surprisingly to me, ssh doesn't lose connection after I deliberately disconnect from the internet, wait for some time and then reconnect again.

Tim
  • 101,790

1 Answers1

5

screen sessions are not killed/terminated when the attaching terminal goes away. They are detached just as if you had detached manually (using Ctrl-a d, probably). That's part of the point of screen.

The disappearance of your screen session is due to some other reason. Perhaps the shell running inside the screen exited on its own or the server got rebooted or the contents of /var/run were deleted by a "helpful" cleanup cron job.

Celada
  • 44,132