简体   繁体   English

Raspberry Pi在重启时不会终止SSH连接

[英]Raspberry Pi not terminating SSH connection on reboot

This has happened to me on multiple occasions and I can't seem to pinpoint the cause of it. 这是我多次发生的情况,我似乎无法查明原因。

Whenever I try to shutdown or reboot the Raspberry Pi via an SSH connection, the system broadcasts it's halting, but doesn't close the SSH connection. 每当我尝试通过SSH连接关闭或重新启动Raspberry Pi时,系统都会广播它正在暂停,但不会关闭SSH连接。 Instead it's left hanging until I type something after a minute and it notes a "Broken Pipe" error. 相反,它会一直挂着,直到一分钟后我键入某些内容,并显示“ Broken Pipe”错误。

The weird thing about this is that it's random across installs. 奇怪的是,它在安装之间是随机的。

On my Pi B, Rev 1, the connection closes. 在我的Pi B版本1中,连接关闭。 Initially this was the case on my Pi 3, but after a reinstall of Raspbian it stopped closing it. 最初在我的Pi 3上就是这种情况,但是在重新安装Raspbian之后,它停止了关闭它。 Another reinstall fixed it, but yesterday I reinstalled again and the problem came back. 另一个重新安装修复了它,但是昨天我再次重新安装了,问题又回来了。

It's seems that I'm the only one who has this problem (or at least has queried other about in online) so I thought I'd pick the brains of whoever stumbled upon this question. 看来,我是唯一一个遇到此问题的人(或至少在网上有其他疑问的人),所以我认为我会选择那些偶然发现此问题的人的大脑。 Anyone have any idea why this happens? 有人知道为什么会这样吗?

PS it's doesn't happen to my other servers, only to the Pi's. PS,其他服务器不会发生这种情况,只有Pi会发生这种情况。

This probably happens as a result of the order of the steps performed during system shutdown. 这可能是由于系统关闭期间执行的步骤顺序而发生的。

The recommended solution is installing libpam-systemd and dbus and making sure that UsePAM is enabled in sshd_config : 推荐的解决方案是安装libpam-systemddbus ,并确保在sshd_config启用UsePAM

apt-get install libpam-systemd dbus

See the following links for a more detailed explanation: 请参阅以下链接以获取更详细的说明:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM