我有一台服务器,显然是随机进入睡眠状态,我无法在系统日志中找出究竟是什么触发了这个状态。
因此我的问题是:什么进程(Es)或事件(S)能够在Ubuntu22.04上实际触发以下systemd目标进入active状态(例如使系统进入睡眠状态)的状态?
$ systemctl status suspend.target
○ suspend.target - Suspend
Loaded: loaded (/lib/systemd/system/suspend.target; static)
Active: inactive (dead)
Docs: man:systemd.special(7)发布于 2022-10-08 22:43:24
那会是
systemctl enable suspend.target 请注意,如果系统服务有故障,enable将出错,并将显示如下:
$ systemctl enable suspend.target
The unit files have no installation config (WantedBy=, RequiredBy=, Also=,
Alias= settings in the [Install] section, and DefaultInstance= for template
units). This means they are not meant to be enabled using systemctl.
Possible reasons for having this kind of units are:
• A unit may be statically enabled by being symlinked from another unit's
.wants/ or .requires/ directory.
• A unit's purpose may be to act as a helper for some other unit which has
a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer,
D-Bus, udev, scripted systemctl call, ...).
• In case of template units, the unit is meant to be enabled with some
instance name specified.如果是的话.这个问题需要第一次解决。
发布于 2022-10-09 00:53:09
从我所看到的是节约能源触发了它。在阅读man systemd.special时,您可以看到suspend.target拉入sleep.target,并在需要时被调用。
suspend.target
A special target unit for suspending the system. This pulls in
sleep.target.
sleep.target
A special target unit that is pulled in by suspend.target,
hibernate.target and hybrid-sleep.target and may be used to hook
units into the sleep state logic.它是由系统服务管理器管理的Special System Units的一部分。
运行systemctl start systemd-suspend.service将使您的系统正常休眠,因为它现在是活动的,因此它必须保持不活动状态,直到需要为止。
https://askubuntu.com/questions/1434487
复制相似问题