2

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.

closed as off-topic by Gilles, jasonwryan, Michael Homer, mdpc, slm Apr 8 '15 at 12:32

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Gilles, jasonwryan, Michael Homer, mdpc, slm
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Had you opened the screen as a different user than the user you logged in as after reconnecting? – Sree Apr 8 '15 at 4:56
  • no. ........................... – Tim Apr 8 '15 at 5:12
  • Having the same problem, did you find a solution? – Tim Autin May 19 at 11:27
3

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.