如何使用 screen bash 命令解决这个问题?
我不小心删除了 /var/run/screen/S-root/25771.pts-0
,当我尝试再次运行 screen 时,
screen bash ...
它报告:
/var/run/screen/S-root /25771.pts-0: 没有这样的文件或目录
如何恢复它?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
检查您是否设置了环境变量
STY
:如果设置了该变量,那么您就是在告诉
screen
重新附加到现有会话。如果该会话不存在,那么您将看到收到的错误。要解决此问题,只需通过运行以下命令清除环境变量:
并尝试再次启动
screen
。发生这种情况的原因可能是您之前运行了一个屏幕会话(为您设置了 STY 环境变量),但该会话现在已关闭。例如:
对
screen
的最终调用将会给您带来错误,因为它仍然具有原始(现已消失)screen
中的环境变量STY
代码>会话。Check to see if you have the environment variable
STY
set: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:
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:
The final call to
screen
will give you your error, because it still has the environment variableSTY
from the original (now-gone)screen
session.这意味着您已经在名为“bash”的屏幕中,
只需使用“exit”命令退出即可。再次运行“screen bash”
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.
如果您找不到要退出或终止的会话,并且每次尝试启动 screen 时都会出现相同的“没有此类文件或目录”错误,请尝试“screen -wipe”。
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".