** Description changed:

  [Impact]
+ When resuming from suspend, the fancontrol service is in a failed state. Fans 
might be stopped, at full speed, or indeterminate state in general.
  
-  * An explanation of the effects of the bug on users and
+ A restart of the service after resume gets it working again, and this
+ fix uses a system-sleep hook script to accomplish that.
  
-  * justification for backporting the fix to the stable release.
- 
-  * In addition, it is helpful, but not required, to include an
-    explanation of how the upload fixes this bug.
+ The change here also includes the change from bug #1967432, so that the
+ service is only restarted if it was active before.
  
  [Test Plan]
  
-  * detailed instructions how to reproduce the bug
+  * detailed instructions how to reproduce the bug
  
-  * these should allow someone who is not familiar with the affected
-    package to reproduce the bug and verify that the updated package fixes
-    the problem.
+  * these should allow someone who is not familiar with the affected
+    package to reproduce the bug and verify that the updated package fixes
+    the problem.
  
-  * if other testing is appropriate to perform before landing this update,
-    this should also be described here.
+  * if other testing is appropriate to perform before landing this update,
+    this should also be described here.
  
  [Where problems could occur]
  
-  * Think about what the upload changes in the software. Imagine the change is
-    wrong or breaks something else: how would this show up?
+  * Think about what the upload changes in the software. Imagine the change is
+    wrong or breaks something else: how would this show up?
  
-  * It is assumed that any SRU candidate patch is well-tested before
-    upload and has a low overall risk of regression, but it's important
-    to make the effort to think about what ''could'' happen in the
-    event of a regression.
+  * It is assumed that any SRU candidate patch is well-tested before
+    upload and has a low overall risk of regression, but it's important
+    to make the effort to think about what ''could'' happen in the
+    event of a regression.
  
-  * This must '''never''' be "None" or "Low", or entirely an argument as to why
-    your upload is low risk.
+  * This must '''never''' be "None" or "Low", or entirely an argument as to why
+    your upload is low risk.
  
-  * This both shows the SRU team that the risks have been considered,
-    and provides guidance to testers in regression-testing the SRU.
+  * This both shows the SRU team that the risks have been considered,
+    and provides guidance to testers in regression-testing the SRU.
  
  [Other Info]
-  
-  * Anything else you think is useful to include
-  * Anticipate questions from users, SRU, +1 maintenance, security teams and 
the Technical Board
-  * and address these questions in advance
  
+  * Anything else you think is useful to include
+  * Anticipate questions from users, SRU, +1 maintenance, security teams and 
the Technical Board
+  * and address these questions in advance
  
  [Original Description]
  
  fancontrol system daemon works great. If I suspend to RAM and wake up
  again it fails:
  
  > sudo service fancontrol status
  
  fancontrol.service - fan speed regulator
       Loaded: loaded (/lib/systemd/system/fancontrol.service; enabled; vendor 
preset: enabled)
       Active: failed (Result: exit-code) since Fri 2020-06-05 18:47:10 CEST; 
6s ago
         Docs: man:fancontrol(8)
               man:pwmconfig(8)
      Process: 624293 ExecStartPre=/usr/sbin/fancontrol --check (code=exited, 
status=0/SUCCESS)
      Process: 624444 ExecStart=/usr/sbin/fancontrol (code=exited, 
status=1/FAILURE)
     Main PID: 624444 (code=exited, status=1/FAILURE)
  
  Jun 05 18:33:43 jeeves fancontrol[624444]: Adjusing hwmon0/device/fan1_input 
-> hwmon0/fan1_input
  Jun 05 18:33:43 jeeves fancontrol[624444]: Enabling PWM on fans...
  Jun 05 18:33:43 jeeves fancontrol[624444]: Starting automatic fan control...
  Jun 05 18:47:09 jeeves fancontrol[624444]: /usr/sbin/fancontrol: line 643: 
echo: write error: Device or resource busy
  Jun 05 18:47:10 jeeves fancontrol[624444]: /usr/sbin/fancontrol: line 649: 
echo: write error: Device or resource busy
  Jun 05 18:47:10 jeeves fancontrol[624444]: Error writing PWM value to 
/sys/class/hwmon/hwmon0/pwm1
  Jun 05 18:47:10 jeeves fancontrol[624444]: Aborting, restoring fans...
  Jun 05 18:47:10 jeeves fancontrol[624444]: Verify fans have returned to full 
speed
  Jun 05 18:47:10 jeeves systemd[1]: fancontrol.service: Main process exited, 
code=exited, status=1/FAILURE
  Jun 05 18:47:10 jeeves systemd[1]: fancontrol.service: Failed with result 
'exit-code'.
  
  BUGFIX: add file to /lib/systemd/system-sleep/fancontrol with content
  #!/bin/bash
  case "$1" in
  post)
    exec service fancontrol restart;;
  esac
  
  ProblemType: Bug
  DistroRelease: Ubuntu 20.04
  Package: fancontrol 1:3.6.0-2ubuntu1
  ProcVersionSignature: Ubuntu 5.4.0-31.35-generic 5.4.34
  Uname: Linux 5.4.0-31-generic x86_64
  NonfreeKernelModules: nvidia_modeset nvidia
  ApportVersion: 2.20.11-0ubuntu27
  Architecture: amd64
  CasperMD5CheckResult: skip
  CurrentDesktop: KDE
  Date: Fri Jun  5 18:41:51 2020
  InstallationDate: Installed on 2020-05-08 (28 days ago)
  InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
  PackageArchitecture: all
  SourcePackage: lm-sensors
  UpgradeStatus: No upgrade log present (probably fresh install)

** Description changed:

  [Impact]
- When resuming from suspend, the fancontrol service is in a failed state. Fans 
might be stopped, at full speed, or indeterminate state in general.
+ When resuming from suspend, the fancontrol service is in a failed state. Fans 
might be stopped, at full speed, or in an indeterminate state.
  
  A restart of the service after resume gets it working again, and this
  fix uses a system-sleep hook script to accomplish that.
  
  The change here also includes the change from bug #1967432, so that the
  service is only restarted if it was active before.
  
  [Test Plan]
+ There are two hardware requirements to fully test this SRU:
+ - a machine capable of suspend/resume, like a laptop
+ - a machine with hardware fan control compatible with fancontrol/lm-sensors
  
-  * detailed instructions how to reproduce the bug
+ A valid /etc/fancontrol configuration file must be generated, either
+ manually or via pwmconfig(8). Without this file, the fancontrol service
+ won't start.
  
-  * these should allow someone who is not familiar with the affected
-    package to reproduce the bug and verify that the updated package fixes
-    the problem.
+ I didn't have any of those when preparing the fix, so I used a similarly
+ configured systemd service to emulate what would happen (rsync in this
+ case, which also depends on a config file to start).
  
-  * if other testing is appropriate to perform before landing this update,
-    this should also be described here.
+ With the above setup, this is the test plan.
+ 
+ For the following combinations, check that the desired result wrt
+ fancontrol.service is achieved when resuming from suspend:
+ 
+ At suspend time -> When resuming:
+ 
+ Service is enabled and active --> is restarted
+ Service is disabled and active --> is restarted
+ Service is enabled and inactive --> is not restarted
+ Service is disabled and inactive --> is not restarted
+ 
  
  [Where problems could occur]
  
   * Think about what the upload changes in the software. Imagine the change is
     wrong or breaks something else: how would this show up?
  
   * It is assumed that any SRU candidate patch is well-tested before
     upload and has a low overall risk of regression, but it's important
     to make the effort to think about what ''could'' happen in the
     event of a regression.
  
   * This must '''never''' be "None" or "Low", or entirely an argument as to why
     your upload is low risk.
  
   * This both shows the SRU team that the risks have been considered,
     and provides guidance to testers in regression-testing the SRU.
  
  [Other Info]
  
   * Anything else you think is useful to include
   * Anticipate questions from users, SRU, +1 maintenance, security teams and 
the Technical Board
   * and address these questions in advance
  
  [Original Description]
  
  fancontrol system daemon works great. If I suspend to RAM and wake up
  again it fails:
  
  > sudo service fancontrol status
  
  fancontrol.service - fan speed regulator
       Loaded: loaded (/lib/systemd/system/fancontrol.service; enabled; vendor 
preset: enabled)
       Active: failed (Result: exit-code) since Fri 2020-06-05 18:47:10 CEST; 
6s ago
         Docs: man:fancontrol(8)
               man:pwmconfig(8)
      Process: 624293 ExecStartPre=/usr/sbin/fancontrol --check (code=exited, 
status=0/SUCCESS)
      Process: 624444 ExecStart=/usr/sbin/fancontrol (code=exited, 
status=1/FAILURE)
     Main PID: 624444 (code=exited, status=1/FAILURE)
  
  Jun 05 18:33:43 jeeves fancontrol[624444]: Adjusing hwmon0/device/fan1_input 
-> hwmon0/fan1_input
  Jun 05 18:33:43 jeeves fancontrol[624444]: Enabling PWM on fans...
  Jun 05 18:33:43 jeeves fancontrol[624444]: Starting automatic fan control...
  Jun 05 18:47:09 jeeves fancontrol[624444]: /usr/sbin/fancontrol: line 643: 
echo: write error: Device or resource busy
  Jun 05 18:47:10 jeeves fancontrol[624444]: /usr/sbin/fancontrol: line 649: 
echo: write error: Device or resource busy
  Jun 05 18:47:10 jeeves fancontrol[624444]: Error writing PWM value to 
/sys/class/hwmon/hwmon0/pwm1
  Jun 05 18:47:10 jeeves fancontrol[624444]: Aborting, restoring fans...
  Jun 05 18:47:10 jeeves fancontrol[624444]: Verify fans have returned to full 
speed
  Jun 05 18:47:10 jeeves systemd[1]: fancontrol.service: Main process exited, 
code=exited, status=1/FAILURE
  Jun 05 18:47:10 jeeves systemd[1]: fancontrol.service: Failed with result 
'exit-code'.
  
  BUGFIX: add file to /lib/systemd/system-sleep/fancontrol with content
  #!/bin/bash
  case "$1" in
  post)
    exec service fancontrol restart;;
  esac
  
  ProblemType: Bug
  DistroRelease: Ubuntu 20.04
  Package: fancontrol 1:3.6.0-2ubuntu1
  ProcVersionSignature: Ubuntu 5.4.0-31.35-generic 5.4.34
  Uname: Linux 5.4.0-31-generic x86_64
  NonfreeKernelModules: nvidia_modeset nvidia
  ApportVersion: 2.20.11-0ubuntu27
  Architecture: amd64
  CasperMD5CheckResult: skip
  CurrentDesktop: KDE
  Date: Fri Jun  5 18:41:51 2020
  InstallationDate: Installed on 2020-05-08 (28 days ago)
  InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
  PackageArchitecture: all
  SourcePackage: lm-sensors
  UpgradeStatus: No upgrade log present (probably fresh install)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1882272

Title:
  fancontrol does not work after sleep/wakeup

To manage notifications about this bug go to:
https://bugs.launchpad.net/lmsensors/+bug/1882272/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to