开发者

How to fix up this problem with screen bash command?

开发者 https://www.devze.com 2023-01-04 22:34 出处:网络
I accidently deleted /var/run/screen/S-root/25771.pts-0 and w开发者_如何学Pythonhen I try to run screen again

I accidently deleted /var/run/screen/S-root/25771.pts-0 and w开发者_如何学Pythonhen 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?


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.


It means you are already in screen named "bash"

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


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.


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".

0

精彩评论

暂无评论...
验证码 换一张
取 消