fix for failure after system suspend/resume
Brought to you by:
cjmueller
Hello,
when the system is suspended and resumed, hd-idle does not work correctly.
My solution is to just restart the hd-idle service on suspend/resume.
This is for Ubuntu 16.04 with systemd. Systemd automatically manages the /etc/init.d/hd-idle as a service.
I have created a new systemd-unit that restarts the hd-idle service, see attachment. It needs to be put into
/etc/systemd/system/
and must be activated with the command
systemctl enable hd-idle-restart-resume.service
(I guess debhelper will care for this to be added to postinst)
I created a patch to address the resume issue. The approach taken here is to identify if the sleep took longer than expected and reset the spum_down flag if we waited too long for the main loop sleep. This should capture suspend events as well as excessive machine load.
I also added a few more log functions (included in the patch). Perhaps the logging could be revised as a separate thread, or employ syslog if your platform environment includes syslog?