LoginSignup
18

More than 5 years have passed since last update.

CentOS7でノートPCを閉じてもサスペンドさせない

Last updated at Posted at 2015-09-12

この記事はWeb開発をするまでの一部です

ノートPCはバッテリーがついてるので、ブレーカーが落ちたり停電があっても落ちないので軽くサーバを立てて遊んでみようという場合には便利です。

ただ、サーバ用途で使ってるノートPCを閉じてサスペンドされると不便なので機能を停止します。

CentOS7からsystemdで管理されています。

LidSwitchが蓋を閉じた時の制御
SuspendKeyがサスペンドキーを押した時の制御
HibernateKeyがハイバーネートキーを押した制御

どれも無効にしてしまいます。

vi /etc/systemd/logind.conf
-#HandleSuspendKey=suspend
-#HandleHibernateKey=hibernate
-#HandleLidSwitch=suspend
+HandleSuspendKey=ignore
+HandleHibernateKey=ignore
+HandleLidSwitch=ignore

反映させます

systemctl restart systemd-logind.service

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
18