6

I've seen this question and this question, but neither of them apply to me. I have the socket file in /var/run/screen and I own it - but screen -list doesn't recognize it and allow me to connect. How can I recover this session?

tom@host~ $ ls /var/run/screen/S-tom/
total 0
prw------- 1 tom people 0 Jul  2 19:07 3954.pts-0.host

tom@host ~ $ screen -list
No Sockets found in /home/tom/.screen.

1 Answer 1

8

You can set the SCREENDIR environment variable to /var/run/screen. You should then be able to list and connect.

Assuming sh compatible shell:

export SCREENDIR="/var/run/screen"

From man 1 screen

ENVIRONMENT
   COLUMNS        Number of columns on the terminal (overrides termcap entry).
   HOME           Directory in which to look for .screenrc.
   LINES          Number of lines on the terminal (overrides termcap entry).
   LOCKPRG        Screen lock program.
   NETHACKOPTIONS Turns on nethack option.
   PATH           Used for locating programs to run.
   SCREENCAP      For customizing a terminal's TERMCAP value.
   SCREENDIR      Alternate socket directory.
   SCREENRC       Alternate user screenrc file.
   SHELL          Default shell program for opening windows (default "/bin/sh").
   STY            Alternate socket name.
   SYSSCREENRC    Alternate system screenrc file.
   TERM           Terminal name.
   TERMCAP        Terminal description.
   WINDOW         Window number of a window (at creation time).
1
  • 1
    I have no idea why I had to do this, but it worked! Thank you.
    – Tom Ritter
    Jul 5, 2012 at 15:07

You must log in to answer this question.

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