httpinterpret
httpinterpret

Reputation: 6729

How to fix up this problem with screen bash command?

I accidently deleted /var/run/screen/S-root/25771.pts-0 and when I try to run screen again

screen bash ...

it reports:

/var/run/screen/S-root/25771.pts-0: No such file or directory

How can I recover it?

Upvotes: 6

Views: 11027

Answers (4)

davidg
davidg

Reputation: 6027

Check to see if you have the environment variable STY set:

[user@machine ~] echo $STY
25771.pts-0

If the variable is set, then you are telling screen to reattach to an existing session. If that session doesn't exist, then you will see the error you are getting.

To solve this, just clear the environment variable by running:

export STY=

and try starting screen again.

This scenario may have occurred because you previously had a screen session running (which setup the STY environment variable for you) which has now closed. For example:

xterm
screen
# The following xterm will inherit the existing STY environment variable.
xterm &
# close the initial xterm, and in the new xterm run the following:
screen

The final call to screen will give you your error, because it still has the environment variable STY from the original (now-gone) screen session.

Upvotes: 20

fbs0601
fbs0601

Reputation: 1

If you don't find a session to exit or kill and get the same "No such file or directory" error every time you try to start screen, try "screen -wipe".

Upvotes: -1

silent
silent

Reputation: 3923

It means you are already in screen named "bash"

Just exit it with "exit" command. And run again "screen bash"

Upvotes: 3

andcoz
andcoz

Reputation: 2232

IMHO if you deleted the screen socket, there is no method to recover that screen instance.

You have to exit from screen and run it again.

Upvotes: 0

Related Questions