0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CentOS7で電源ボタンを押してshutdownさせたい

Last updated at Posted at 2020-05-01

はじめに

私の管理してる某大学の端末室30台にCentOS7を導入したのですが、電源ボタンを押すと休止状態になる事に気がつきました。

個人的な利用ならこれでも構わないのですが、大学の端末室で共同利用なので休止状態にして退室されると困ります。

電源ボタンを押したらshutdownに変更したいと考えました。

これですが、一筋縄でいかず、うまくいきません(>_<)

数日検索&試行錯誤した結果、途中の結果は置いておいて以下の設定でうまくいきました。

OSのインストール

多くのPCのセットアップ画面でUEFIモードかLagcy BIOSモードか選べると思いますが、UEFIではどう頑張ってもダメでした。

Lagcy BIOSでOS導入してください。すでにUEFIモードでOS導入していたらOS再インストールになります。Lagcy BIOSモードが選べないPCだったらどうにもなりません。

なお、Lagcy BIOSモードでは2[Tbyte]を超えるHDDへはOS導入できません。

ソフトウエアの設定

acpiサービスを導入してください。

yum install acpid
service acpid start
chkconfig acpid on

以下のファイルを書き換えてください。

/etc/acpi/events/powerconf
# 以下の行をコメントにして
# action=/etc/acpi/actions/power.sh
# 以下を加筆
action=/sbin/poweroff

OSを再起動してください。

参考文献
Ref: https://serverfault.com/questions/705035/centos-7-power-button-cannot-shutdown-before-user-login-not-after

確認

念のため以下で確認ください。私の環境では以下の全てで電源ボタンを押すことによりOSがshutdownできました。

-GUIでログインした状態
-GUIログインして、画面ロックした状態
-ログインする前の状態

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?