I've got a screen session running which I would like to :quit, but I can't because when I try to re-attach, I get an error saying it can't open my terminal. I'm sure I could kill the daemon or something, but I need to learn the "right" way, as well as what's actually going on.
daniel@DELIRIUM:~/server1/bin/plugins$ screen -list
There is a screen on:
1424.pts-0.DELIRIUM (06/23/2011 01:18:14 PM) (Detached)
1 Socket in /var/run/screen/S-daniel.
daniel@DELIRIUM:~/server1/bin/plugins$ screen -r 1424
Cannot open your terminal '/dev/pts/0' - please check.
Also, what is a socket? The more you can dumb it down the better.
Best Answer
You don't own your TTY for some reason. Did you use
su
to change to that user from another user? Normally the TTY is owned by the person who originally logs into that terminal.There's a neat trick to fix this (other than changing the permissions on the /dev/pts/0 file by the user who originally logged in), the
bsdutils
package has a program calledscript
which, when run, acts something like a keylogger, saving both what you type and what programs print. It starts another shell and allocates another pseudotty for that shell in order to record all this, so if you runscript /dev/null
it will create a new pseudotty with proper permissions, and start recording everything on it to /dev/null. Then you will be able to use screen to reattach your session.As for "sockets", this is screen's term for the named pipe files (also known as FIFOs) in
/var/run/screen/S-username
, egWhen you first start screen, this pipe file is created in order to connect the
screen
process you are using to view the displays with the backgroundscreen
process (usually renamedSCREEN
) the programs are actually running in. When you runscreen -r
, the screen process you are running opens this pipe to talk to the background screen process.