Ubuntu 22.04 - 暂停然后休眠失败,结果为“依赖性”

Ubuntu 22.04 - 暂停然后休眠失败,结果为“依赖性”

最近,挂起至休眠功能无法可靠地工作。虽然应该进入休眠状态,但电池却耗尽了。

这是什么

journalctl | grep suspend

显示:

Nov 26 05:09:15 XYZ kernel: PM: suspend entry (s2idle)
Nov 26 05:09:15 XYZ kernel: PM: suspend exit
Nov 26 05:09:15 XYZ systemd[1]: systemd-suspend-then-hibernate.service: Main process exited, code=exited, status=1/FAILURE
Nov 26 05:09:15 XYZ systemd[1]: systemd-suspend-then-hibernate.service: Failed with result 'exit-code'.
Nov 26 05:09:15 XYZ systemd[1]: suspend-then-hibernate.target: Job suspend-then-hibernate.target/start failed with result 'dependency'.
Nov 26 05:09:15 XYZ systemd[1]: systemd-suspend-then-hibernate.service: Consumed 2.151s CPU time.
Nov 26 05:09:15 XYZ ModemManager[1057]: <info>  [sleep-monitor-systemd] system is about to suspend
Nov 26 05:09:15 XYZ systemd-sleep[137140]: Entering sleep state 'suspend'...
Nov 26 05:09:15 XYZ kernel: PM: suspend entry (deep)
Nov 26 05:09:35 XYZ kernel: PM: suspend exit
Nov 26 05:09:35 XYZ kernel: PM: suspend entry (s2idle)

这种情况就这样循环发生,直到电池耗尽。所以我的理解是,某种程度上存在依赖关系,阻止它进入休眠状态?

通过终端执行挂起或休眠功能可以正常工作:

systemctl suspend
Nov 26 16:39:11 XYZ ModemManager[933]: <info>  [sleep-monitor-systemd] system is about to suspend
Nov 26 16:39:14 XYZ systemd-sleep[19184]: Entering sleep state 'suspend'...
Nov 26 16:39:14 XYZ kernel: PM: suspend entry (deep)
Nov 26 16:39:27 XYZ kernel: printk: Suspending console(s) (use no_console_suspend to debug)
Nov 26 16:39:27 XYZ kernel: PM: suspend exit
Nov 26 16:39:27 XYZ systemd[1]: systemd-suspend.service: Deactivated successfully.
Nov 26 17:21:10 XYZ ModemManager[933]: <info>  [sleep-monitor-systemd] system is about to suspend
Nov 26 17:22:31 XYZ kernel: printk: Suspending console(s) (use no_console_suspend to debug)

有任何想法吗?

更新:

似乎我在错误的地方截断了 journalctl 内容。我现在做了以下事情:

  1. 执行 sudo systemctl suspend,然后保存 journalctl
  2. 执行 sudo hibernate,然后保存 journalctl
  3. 执行 sudo suspend-then-hibernate,然后保存 journalctl
  4. 合上盖子(这应该会触发挂起然后休眠),然后保存 journalctl

这表明 #1-3 运行正常,而 #4 出现故障。以下是 #3 的相关日志部分:

Dez 12 20:52:05 XYZ systemd[1]: Starting Record successful boot for GRUB...
Dez 12 20:52:05 XYZ systemd[1]: Starting Suspend; Hibernate if not used for a period of time...
Dez 12 20:52:05 XYZ systemd-sleep[8780]: Entering sleep state 'suspend'...
Dez 12 20:52:05 XYZ kernel: PM: suspend entry (deep)
Dez 12 20:52:26 XYZ kernel: Filesystems sync: 0.006 seconds
Dez 12 20:52:26 XYZ kernel: Freezing user space processes
Dez 12 20:52:26 XYZ kernel: Freezing user space processes completed (elapsed 0.004 seconds)
Dez 12 20:52:26 XYZ kernel: OOM killer disabled.
Dez 12 20:52:26 XYZ kernel: Freezing remaining freezable tasks
Dez 12 20:52:26 XYZ kernel: Freezing remaining freezable tasks completed (elapsed 0.001 seconds)

对于 #4:

Dez 12 21:19:10 XYZ systemd[1]: Starting Record successful boot for GRUB...
Dez 12 21:19:10 XYZ systemd[1]: Starting Suspend; Hibernate if not used for a period of time...
Dez 12 21:19:10 XYZ systemd-sleep[19771]: Entering sleep state 'suspend'...
Dez 12 21:19:10 XYZ kernel: PM: suspend entry (deep)
Dez 12 21:19:10 XYZ kernel: Filesystems sync: 0.033 seconds
Dez 12 21:19:30 XYZ kernel: Freezing user space processes
Dez 12 21:19:30 XYZ kernel: Freezing user space processes failed after 20.007 seconds (1 tasks refusing to freeze, wq_busy=0):
Dez 12 21:19:30 XYZ kernel: task:modprobe        state:D stack:0     pid:19662 ppid:1948   flags:0x00004006
Dez 12 21:19:30 XYZ kernel: Call Trace:

这种现象会不断重复,直到电池耗尽。搜索 modprobe 也没有找到答案。有什么想法吗?

更新 2:

我想我已经找到了问题所在。我经常需要重新启动 pulseaudio (通过 pulseaudio -k && sudo alsa force-reload,从这里),由于音频问题,似乎此过程正在后台运行并阻止它捂脸. 重新启动后,对盖子关闭进行快速检查并成功触发挂起然后休眠,目前已证实了这一点。

答案1

不要发布日志(“这是我对所有数据的猜测 - 你自己看着办吧”)。

诊断程序:

第一步是在时间流中放置一个图钉

date '+%y-%m-%d %H:%M:%S' >pin.tmp

然后,执行暂停/关闭操作。当您的系统再次可用时,

sudo journalctl  --since="$(cat pin.tmp)"

这将显示自您设置以来的所有日志消息pin.tmp。一些消息与您的问题有关。

或者,

系统重新启动后,终端命令sudo journalctl b -1 -ex将显示导致崩溃/关机的系统日志。您可以通过改变选项来查看其他关机-b -1。如果没有任何异常,则怀疑是过热或突然断电。请sudo journalctl --list-boots阅读man journalctl。如需更多journalctl帮助,请参阅我的 AskUbuntu 个人资料(单击我的用户名)。

相关内容