Debian 10 - 電源ボタンを使ってサーバーの電源を切る方法、acpiをテストする方法は?

Debian 10 - 電源ボタンを使ってサーバーの電源を切る方法、acpiをテストする方法は?

手動でログインしてサーバーの電源を切るのではなく、シャーシの前面にある電源ボタンを使用してサーバーの電源を切ることができます。

これまでに調査したところによると、これを行うにはacpiをインストールする必要があると思います。

acpiサービスを起動し、systemctlを使用して有効にしました。現在の状態は「アクティブ」です。

ところで、ボタンを押すと、システムの電源が切れているのか、省電力モードなのかはわかりません。

もう一度押すとすばやく再起動するので、スリープ状態になって電源が切れないようです。

acpiが正常に動作しているかどうかをテストする方法は?私はシステムログファイルを見つけましたが、/var/log/syslogそこに内容が多すぎるので、正確に何を見つけるべきかわかりません。

ベストアンサー1

以下を編集して電源ボタンの動作を設定できます/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
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192

その行のコメントを外し#HandlePowerKey=poweroffて再起動します(Debian 10では、電源ボタンを押すとデフォルトで電源が切れたように見えますが)。

おすすめ記事