PDA

View Full Version : Fancontrol using systemd instead of Sys V Inits



stevef9432203
24th November 2012, 07:37 PM
Hello Folks -

I use fancontrol which is a part of lm_sensors, to control fan speeds on my laptop and desktop.

It works well enough, but on the Laptop after suspend, I would need to restart it.

Looking around on the Net, and found that systemd would allow a service to run after resume.


After much fumbling around I ended up with these two services -

fancontrol.service
-------------------------------------------------------------
[Unit]
Description=Fan control daemon

[Service]
Type=simple
User=root
ExecStart=/usr/sbin/fancontrol -D

[Install]
WantedBy=multi-user.target
------------------------------------------------------------


fancontrol-resume.service
------------------------------------------------------------
[Unit]
Description=Restart fancontrol after resume from sleep/suspend
After=suspend.target

[Service]
Type=simple
ExecStart=/usr/bin/systemctl restart fancontrol.service

[Install]
WantedBy=suspend.target
-----------------------------------------------------------------


Copy these files in to two files in /usr/lib/systemd/system

Be sure to activation them

systemctl enable fancontrol.service
systemctl enable fancontrol-resume.service

And Start Them

systemctl start fancontrol.service

Keep in mind you must lm_sensors installed and configured properly.

Have fun

justFlow
23rd April 2013, 02:25 PM
Thx, works like a charm :)