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.

[systemd] suspendするとfancontrolが働かなくなる問題の対処法

Last updated at Posted at 2020-04-27

環境

Linux Ubuntu bionic xfce

はじめに

ファンを制御してくれるfancontrolですがsuspendするとなぜだか設定がリセットされてしまう症状が起こりました。解決策を次に示します。

解決法

その① 復帰後に実行するシェルを作成

systemdsystem-sleep配下にsuspendから復帰したときの動作を指定するシェルを作成します。(名前は何でも良いです。)

/lib/systemd/system-sleep/fancontrol-restart
# !/bin/bash
case "$1" in
post)
  exec service fancontrol restart;;
esac

その② リスタート用のサービスを作成

suspend.targetが起動した後にsystemctlを実行するサービスを作成する

/lib/systemd/system/restart-systemd
[Unit]
Description=restart systemctl
After=suspend.target
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl restart fancontrol
[Install]
WantedBy=suspend.target
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?