雲主機 Ubuntu 22.04.4 LTS 更新後每隔20分鐘伺服器就停止響應

AlexChow發表於2024-06-21

翻看了好多日誌, 最終發現這幾行

Jun  8 00:59:21 vps-274006-mix NetworkManager[855]: <info>  [1717801161.0426] manager: sleep: sleep requested (sleeping: no  enabled: yes)
Jun  8 00:59:21 vps-274006-mix ModemManager[1182]: <info>  [sleep-monitor-systemd] system is about to suspend
Jun  8 00:59:21 vps-274006-mix NetworkManager[855]: <info>  [1717801161.0429] manager: NetworkManager state is now ASLEEP
Jun  8 00:59:21 vps-274006-mix NetworkManager[855]: <info>  [1717801161.0426] manager: sleep: sleep requested (sleeping: no  enabled: yes)
Jun  8 00:59:21 vps-274006-mix ModemManager[1182]: <info>  [sleep-monitor-systemd] system is about to suspend
Jun  8 00:59:21 vps-274006-mix NetworkManager[855]: <info>  [1717801161.0429] manager: NetworkManager state is now ASLEEP
Jun  8 00:59:21 vps-274006-mix systemd[1]: Reached target Sleep.
Jun  8 00:59:21 vps-274006-mix gnome-shell[1878]: Screen lock is locked down, not locking
Jun  8 00:59:21 vps-274006-mix systemd[1]: Starting Record successful boot for GRUB...
Jun  8 00:59:21 vps-274006-mix systemd[1]: Starting System Suspend...
Jun  8 00:59:21 vps-274006-mix systemd[1]: grub-common.service: Deactivated successfully.
Jun  8 00:59:21 vps-274006-mix systemd[1]: Finished Record successful boot for GRUB.
Jun  8 00:59:21 vps-274006-mix systemd[1]: Starting GRUB failed boot detection...
Jun  8 00:59:21 vps-274006-mix kernel: [ 1211.219495] PM: suspend entry (deep)
Jun  8 00:59:21 vps-274006-mix systemd-sleep[8170]: Entering sleep state 'suspend'...

確診 ubuntu 更新後不知為何啟動了20分鐘自動休眠
透過命令調整休眠時間解決問題

root@vps-274006-mix:~# gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout
1200
root@vps-274006-mix:~# gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
root@vps-274006-mix:~# gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout
0

相關文章