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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章