为什么“systemctl reboot”不起作用?

为什么“systemctl reboot”不起作用?

为什么这些命令在 Kubuntu 20.04 中不起作用?应用程序关闭并且屏幕变黑,但无法完成关机。有什么想法吗?

systemctl poweroff
systemctl reboot

https://askubuntu.com/a/479368/795299

我应该澄清一下……常规 GUI 重启和关机按钮工作正常。常规 CLI 命令(rebootshutdown -H now)也不起作用。但它们确实如此,我担心它们更突然,不给应用程序保存和关闭的时间。

以下是一些错误journalctl -r(反向顺序):

Dec 10 14:21:31 osboxes kernel: Fixing recursive fault but reboot is needed!
...theres a big chunk of what looks like machine code numbers for the kernel here...
Dec 10 14:21:31 osboxes kernel: CPU: 13 PID: 2635 Comm: QQmlThread Tainted: P           OE     5.4.0-91-generic #102-Ubuntu
Dec 10 14:21:31 osboxes kernel: Oops: 0010 [#1] SMP PTI
Dec 10 14:21:31 osboxes kernel: PGD 0 P4D 0 
Dec 10 14:21:31 osboxes kernel: #PF: error_code(0x0010) - not-present page
Dec 10 14:21:31 osboxes kernel: #PF: supervisor instruction fetch in kernel mode
Dec 10 14:21:31 osboxes kernel: BUG: kernel NULL pointer dereference, address: 0000000000000000
Dec 10 14:21:31 osboxes pulseaudio[7418]: GetManagedObjects() failed: org.freedesktop.systemd1.ShuttingDown: Refusing activation, D-Bus is shutting down.
Dec 10 14:21:31 osboxes dbus-daemon[1171]: [system] Activation via systemd failed for unit 'dbus-org.bluez.service': Refusing activation, D-Bus is shutting down.
Dec 10 14:21:31 osboxes dbus-daemon[1171]: [system] Activation via systemd failed for unit 'rtkit-daemon.service': Refusing activation, D-Bus is shutting down.
...this error repeats for 10 dbus-daemon messages...
Dec 10 14:21:28 osboxes dbus-daemon[2354]: [session uid=1001 pid=2354] Activated service 'org.kde.kglobalaccel' failed: Process org.kde.kglobalaccel received signal 6
Dec 10 14:21:28 osboxes org.kde.kglobalaccel[7171]: Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposi>
Dec 10 14:21:28 osboxes org.kde.kglobalaccel[7171]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Dec 10 14:21:28 osboxes org.kde.kglobalaccel[7171]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
..no errors for about 15 lines..
Dec 10 14:21:28 osboxes systemd[1]: Stopped ACPI event daemon.
Dec 10 14:21:28 osboxes systemd[1]: acpid.service: Succeeded.
Dec 10 14:21:28 osboxes org.kde.kglobalaccel[7171]: qt.qpa.xcb: could not connect to display :0
Dec 10 14:21:27 osboxes kernel: snd_hda_codec_hdmi hdaudioC1D1: HDMI: invalid ELD data byte 9
Dec 10 14:21:27 osboxes systemd[1]: finalrd.service: Succeeded.
Dec 10 14:21:27 osboxes systemd[1]: Failed unmounting /media/abc/VHDs.
..added below errors..
Dec 10 17:55:40 osboxes systemd-udevd[16858]: veth5ed07fa: Failed to get link config: No such device
Dec 10 17:55:40 osboxes systemd-tmpfiles[17063]: [/run/finalrd-libs.conf:9] Duplicate line for path "/run/initramfs/lib64", ignoring.
Dec 10 17:55:40 osboxes libvirtd[1290]: unable to read: /sys/class/net/veth5ed07fa/operstate: No such file or directory
Dec 10 17:55:40 osboxes libvirtd[1290]: Failed to open file '/sys/class/net/veth5ed07fa/operstate': No such file or directory

卸载错误来自指向 docker 目录到数据分区的符号链接。禁用 fstab 中的挂载点无法解决。

最后一条消息似乎与 acpi 有关:错误“修复递归错误但需要重新启动”。但使用acpi noirq没有解决。

对比 journalctl 和使用桌面上的重启按钮是否成功,我发现有类似的 dbus-daemon 消息和卸载错误,但没有内核错误。有一个“NVIDIA ACPI 视频驱动程序...失败,退出代码”,但它仍然成功。

reboot如果我没有先以用户身份从 sddm 登录,则可以从 tty2 工作。

答案1

这没有答案为什么“systemctl reboot”不起作用?,但它可能会解决您的问题。

尝试

$ sudo shutdown
$ sudo shutdown -r

您可以配置您的系统,这样您就不需要了sudo

另一个选择是添加acpi=noirq到 grub 行

可能的原因是Nvidia 驱动程序

请进一步挖掘阅读并发布输出journalctl包括关机/重启失败,

$ journalctl --list-boots > boots.txt
$ journalctl --no-pager -b > boot_minus0.txt
$ journalctl --no-pager -b -1 > boot_minus1.txt
...

这将创建您稍后可以上传到 pastebin 的文件。请花点时间检查它们。

有关的

  1. https://www.debian.org/releases/buster/amd64/ch08s01.en.html

答案2

dmesg内核日志中,您忽略了一个重要细节: 内核哎呀!

Dec 10 14:21:31 osboxes kernel: Fixing recursive fault but reboot is needed!
...theres a big chunk of what looks like machine code numbers for the kernel here...
Dec 10 14:21:31 osboxes kernel: CPU: 13 PID: 2635 Comm: QQmlThread Tainted: P           OE     5.4.0-91-generic #102-Ubuntu
Dec 10 14:21:31 osboxes kernel: Oops: 0010 [#1] SMP PTI
Dec 10 14:21:31 osboxes kernel: PGD 0 P4D 0 
Dec 10 14:21:31 osboxes kernel: #PF: error_code(0x0010) - not-present page
Dec 10 14:21:31 osboxes kernel: #PF: supervisor instruction fetch in kernel mode
Dec 10 14:21:31 osboxes kernel: BUG: kernel NULL pointer dereference, address: 0000000000000000

Linux 内核“Oops”是当某些东西出现故障或内核代码中出现异常时抛出的错误。它类似于用户空间中的段错误。在出现 Oops 之后,当故障发生时,您会删除 CPU 寄存器崩溃转储。这可能会让回答这个问题的人更清楚地意识到系统发生了其他问题。

触发内核 Oops 的违规进程被终止,没有释放锁或清理结构。在出现内核 Oops 或崩溃的情况下,有时系统甚至可能无法恢复正常操作,并进入可能不稳定的状态或冻结。一旦您发现发生了 Oops 或内核崩溃,就不能再信任计算机保持稳定状态,并且可能应该尽可能顺利地重新启动。尝试魔法 SysRq组合键:(Alt+SysRq + r e i s u b按顺序按下每个组合键)。当内核仍在响应这些中断时,这通常会以更柔和的方式重新启动系统。

如果系统仍然没有响应 Magic SysRq 组合键,那么您可能被迫使用电源按钮进行硬关机。

相关内容