Arch Linux 如何修改默认电源管理设置

如果Arch安装了桌面环境,通常会附带一个电源管理程序,这时候电源管理会被接管,我们会有一个图形化的配置界面。但如果你根本没有安装桌面环境,那这个问题改如何处理呢。

最近把一台闲置的笔记本安装了Arch,想用来做个下载服务器。一切配置完成后发现一个问题,远程重启电脑后无法进行ssh连接,各服务也不通,无法ping通。查看电脑发现睡眠灯已亮,笔记本开盖,立即恢复。马上想到可能是电源管理设置的有问题,遂进入电源管理选项查看设置,可发现一切设置没有问题,关闭盖子不进行任何操作,再次关闭盖子尝试,居然一切正常!!那为什么重启后会睡眠呢??

没错!!我安装的桌面环境是Xfce4!!通过一顿查找发现xfce4-power-manager电源管理的启动是在 xdgautostart,也就是如果不登录进系统Xfce4的电源管理是不会启动的,不启动的话就会使用systemd默认的电源管理选项。

以下就是默认配置,找到关闭盖子的选项HandleLidSwitchHandleLidSwitchExternalPower取消注释,并修改动作为ignore,完成。

~ $ cat /etc/systemd/logind.conf
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See logind.conf(5) for details.

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#UserStopDelaySec=10
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
#HandleRebootKey=reboot
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#RebootKeyIgnoreInhibited=no
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RuntimeDirectoryInodes=400k
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章