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

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

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

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

以下就是默认配置,找到关闭盖子的选项HandleLidSwitch和HandleLidSwitchExternalPower取消注释,并修改动作为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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值