我尝试重新启动我的CentOS 7服务器,但是它提供了荒谬的错误消息。
作为根(当然):
# systemctl reboot
Authorization not available. Check if polkit service is running or see debug message for more information.
Failed to start reboot.target: Connection timed out
See system logs and 'systemctl status reboot.target' for details.
Exit 1
polkit
是否需要检查root
是否有权重新启动机器?如果是,为什么?
# systemctl status reboot.target
● reboot.target - Reboot
Loaded: loaded (/usr/lib/systemd/system/reboot.target; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: man:systemd.special(7)
Exit 3
我需要启用reboot
目标吗?为什么默认情况下会禁用此功能?
也许这个能行?
# systemctl start reboot.target
Authorization not available. Check if polkit service is running or see debug message for more information.
Failed to start reboot.target: Connection timed out
See system logs and 'systemctl status reboot.target' for details.
Exit 1
好的,强迫它,然后:
# systemctl --force reboot
Authorization not available. Check if polkit service is running or see debug message for more information.
Failed to execute operation: Connection timed out
Exit 1
服务器还在运行。
发布于 2019-08-06 20:09:38
尽管看起来很奇怪,试着跑
sudo systemctl --force reboot
在我做过的几次搜索中都出现了。这可能与DBus服务重新启动的问题有关。
发布于 2020-04-07 11:24:59
如果Zach Sanchez的答案不起作用(我在Failed to start reboot.target: Connection timed out
7下得到了systemctl --force reboot
的一个奇怪的情况),使内核基本上崩溃重新引导可以在SSH上作为root完成,如下所示:
# echo s > /proc/sysrq-trigger
# echo u > /proc/sysrq-trigger
# echo b > /proc/sysrq-trigger
在最后一个命令之后,当内核立即重新启动机器时,没有异常的响应。更多细节这里
正如@LunarShaddow等人指出的那样,不需要在"b“之前再加上一个"s”。
发布于 2020-05-07 16:30:39
由于我不能在保罗的回答中发表评论,所以我在这里写我的评论。
来自核心文件:
当你无法关闭时,重新启动(B)是件好事。但你也应该先同步(S)和乌蒙特(U)。当你无法关闭时,重新启动(B)是件好事。但你也应该先同步(S)和乌蒙特(U)。同步(S)是伟大的,当你的系统被锁定,它允许你同步你的磁盘,肯定会减少数据丢失和屏蔽的机会。请注意,在屏幕上显示“确定”和“已完成”之前,同步还没有发生。(如果内核真的处于冲突中,您可能永远得不到OK或is消息.)和同步(S)一样,umount(u)基本上是有用的。我通常同步(S),umount(u),然后重新启动(B),当我的系统锁定。它给我省了很多钱。同样,在屏幕上显示“确定”和“完成”消息之前,卸载(仅重装入只读)还没有发生。
所以FMHO,保罗的答案可以简化为's‘'u’b',你可能想在每次输入之后等一段时间。
https://unix.stackexchange.com/questions/534220
复制相似问题