GUIのLinuxサーバを電源ボタンでシャットダウンする。

2014-09-17 10.09.47
※写真と本文は関係ありません。


OS:CentOS release 6.5 (Final)
GUI: GNOME

ディスプレー・キーボードのない環境で運用している、客先に置いてあるファイル共有サーバ。
CUIで起動している時に電源ボタンを押すとシャットダウンするが、GUI(init 5)の時はダイアログが出て動作を選択しないとシャットダウン出来ない。
客先でシャットダウンするときに不便。

/etc/acpi/events/power.conf を編集する。


# cat /etc/acpi/events/power.conf
# ACPID config to power down machine if powerbutton is pressed, but only if
# no gnome-power-manager is running

event=button/power.*
#action=/etc/acpi/actions/power.sh
action=/sbin/shutdown -h now

編集後acpiのdaemonを再起動する。

# /etc/init.d/acpid restart
acpi デーモンを停止中: [ OK ]
acpi デーモンを起動中: [ OK ]