Ubuntu 桌面运行 18.04,睡眠和休眠关闭,没有插入显示器/键盘,现在已经运行了几个星期,一些自定义服务非常好。
今天早上它没有通过 ssh 响应,并且服务没有与云应用程序通信。
我必须重新启动机器才能访问任何日志。自定义服务在此日志之前仅运行了半秒,因此计算机仍然处于活动状态。一些帮助如何停止这种随机睡眠/冬眠会很棒。
Feb 02 06:54:00 home NetworkManager[709]: <info> [1612248840.1230] manager: sleep: sleep requested (sleeping: no enabled: yes)
Feb 02 06:54:00 home NetworkManager[709]: <info> [1612248840.1236] manager: NetworkManager state is now ASLEEP
Feb 02 06:54:00 home NetworkManager[709]: <info> [1612248840.1253] device (enp1s0): state change: activated -> deactivating (reason 'sleeping', sys-iface-state: 'managed')
Feb 02 06:54:00 home whoopsie[1025]: [06:54:00] offline
Feb 02 06:54:00 home gnome-shell[859]: Screen lock is locked down, not locking
Feb 02 06:54:00 home dbus-daemon[662]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.15' (uid=0 pid=709 comm="/usr/sbin/Network
Feb 02 06:54:00 home NetworkManager[709]: <info> [1612248840.1615] device (enp1s0): state change: deactivating -> disconnected (reason 'sleeping', sys-iface-state: 'managed')
Feb 02 06:54:00 home avahi-daemon[684]: Withdrawing address record for xxx on enp1s0.
Feb 02 06:54:00 home avahi-daemon[684]: Leaving mDNS multicast group on interface enp1s0.IPv6 with address xxx.
Feb 02 06:54:00 home avahi-daemon[684]: Interface enp1s0.IPv6 no longer relevant for mDNS.
Feb 02 06:54:00 home systemd[1]: Starting Network Manager Script Dispatcher Service...
Feb 02 06:54:00 home NetworkManager[709]: <info> [1612248840.1970] dhcp4 (enp1s0): canceled DHCP transaction, DHCP client pid 968
Feb 02 06:54:00 home dbus-daemon[662]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Feb 02 06:54:00 home NetworkManager[709]: <info> [1612248840.1971] dhcp4 (enp1s0): state changed bound -> done
Feb 02 06:54:00 home systemd[1]: Started Network Manager Script Dispatcher Service.
Feb 02 06:54:00 home nm-dispatcher[24574]: req:1 'connectivity-change': new request (1 scripts)
Feb 02 06:54:00 home avahi-daemon[684]: Withdrawing address record for 192.168.4.44 on enp1s0.
Feb 02 06:54:00 home nm-dispatcher[24574]: req:1 'connectivity-change': start running ordered scripts...
Feb 02 06:54:00 home avahi-daemon[684]: Leaving mDNS multicast group on interface enp1s0.IPv4 with address 192.168.4.44.
Feb 02 06:54:00 home avahi-daemon[684]: Interface enp1s0.IPv4 no longer relevant for mDNS.
Feb 02 06:54:00 home NetworkManager[709]: <info> [1612248840.2066] device (enp1s0): state change: disconnected -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
Feb 02 06:54:00 home kernel: r8169 0000:01:00.0 enp1s0: Link is Down
Feb 02 06:54:00 home nm-dispatcher[24574]: req:2 'down' [enp1s0]: new request (1 scripts)
Feb 02 06:54:00 home nm-dispatcher[24574]: req:2 'down' [enp1s0]: start running ordered scripts...
Feb 02 06:54:00 home systemd[1]: Reached target Sleep.
Feb 02 06:54:00 home systemd[1]: Starting Hybrid Suspend+Hibernate...
Feb 02 06:54:00 home kernel: PM: Image not found (code -22)
Feb 02 06:54:00 home systemd-sleep[24587]: Suspending system...
Feb 02 06:54:00 home kernel: PM: hibernation entry
这也是这段时间的功率设置
:/home/me# su - gdm -s /bin/bash
:~$ gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type
'nothing'
:~$ gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type
'nothing'
:~$ dbus-launch gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type
'nothing'
:~$ dbus-launch gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout
0
:~$ dbus-launch gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout
1200
答案1
如果您找不到引起这些睡眠/休眠状态的原因,您可以完全禁用它们(无论如何它是 24/7 服务器)。
systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target