[systemd] How to deal with the problem that fancontrol does not work after suspending

environment

Linux Ubuntu bionic xfce

Introduction

It is a fan control that controls the fan, but when I suspend it, the setting is reset for some reason. Here is the solution:

Solution

Part 1 Create a shell to be executed after returning

Create a shell under system-sleep of systemd that specifies the behavior when returning from suspend. (The name can be anything.)

/lib/systemd/system-sleep/fancontrol-restart


#!/bin/bash
case "$1" in
post)
  exec service fancontrol restart;;
esac

Part 2 Create a service for restart

Create a service that executes systemctl after suspend.target is started

/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

Recommended Posts

[systemd] How to deal with the problem that fancontrol does not work after suspending
[VLC] How to deal with the problem that it is not in the foreground during playback
How to solve the problem that APL does not start after transferring to the actual device on Kivy-iOS
How to deal with Django's Template Does Not Exist
[Pyhton] I want to solve the problem that tkinter does not work on MacOS11
A story about how to deal with the CORS problem
How to deal with the problem that pandas 1.1.0 or later build fails on Alpine Linux
How to deal with the problem that the current directory moves when Python is executed from Atom
After installing php7.2, the php command does not work
How to deal with the problem that build fails when CI / CD of Python Function with AWS Amplify
Solution to the problem that build does not end when installing OpenCV (PEP517)
[AWS] Wordpress How to deal with "The response is not a correct JSON response"
How to deal with the problem that Japanese characters are garbled when outputting logs using JSON log formatter
How to deal with the phenomenon that Python (Jupyter notebook) executed on WSL becomes Aborted
How to deal with the error that Docker's MySQL container fails to start on Docker Toolbox
[GNOME] How to avoid the problem that conversion candidate characters do not disappear when converting to Japanese
How to deal with imbalanced data
How to deal with imbalanced data
Problem that discord.py does not break
The story of the release work of the application that Google does not tell
How to deal with DistributionNotFound errors
How to deal with the error "Failed to load module" canberra-gtk-module "that appears when you run OpenCV
Calling time.sleep () after the print function with the argument end does not print
The 16th offline real-time how to write problem was solved with Python
The 16th offline real-time how to write reference problem to solve with Python
How to fix a bug that jupyter notebook does not start automatically
(Under investigation) USB camera that does not work with WebRTC on RPi4
The module that should have been installed with pip does not run
The 19th offline real-time how to write reference problem to solve with Python
The 15th offline real-time how to write problem was solved with python
How to solve the bin packing problem
How to work with BigQuery in Python
How to deal with enum compatibility errors
gqlgen command does not work with go gqlgen
[Python] How to deal with module errors
How to read problem data with paiza
Intuitive explanation that does not rely on mathematical formulas for the Monty Hall problem and simulation with Python
Example of what to do when the sample script does not work (OpenCV-Python)
I managed to solve the situation where Python does not work on Mac
How to deal with the inability to open the lock file / var / lib / dpkg / lock-frontend
A story that sometimes does not work if pip is up to date
About the problem that the python version of Google App Engine does not mesh
[EC2] How to deal with errors that selenium cannot execute (No module named selenium)
How to deal with memory leaks in matplotlib.pyplot
Try to solve the fizzbuzz problem with Keras
How to specify the NIC to scan with amazon-dash
How to delete log with Docker, not to collect log
How to deal with problems that occur in future prediction using the SARIMA model (seasonal autoregressive integrated moving average model)
can't pickle annoy. How to deal with Annoy objects
How to try the friends-of-friends algorithm with pyfof
How to deal with run-time errors in subprocess.call
How to deal with module'tensorflow' has no attribute'〇〇'
How to deal with SessionNotCreatedException when using Selenium
How to Learn Kaldi with the JUST Corpus
When wildcard specification does not work with pylint
I tried to find out how to streamline the work flow with Excel x Python ②
[Jinja2] Solution to the problem that variables added in the for statement are not inherited
I tried to find out how to streamline the work flow with Excel x Python ⑤
How to use a tp-link wireless LAN slave unit that does not support Linux
I tried to find out how to streamline the work flow with Excel x Python ①
Solved the problem that the image was not displayed in ROMol when loaded with PandasTools.LoadSDF.