You are not logged in.
I've used the laptop-mode-tools now for quite some time. However, recently the power management settings are not applied anymore. Possibly since updating to systemd...
My laptop-mode.conf looks as follows:
CONTROL_HD_POWERMGMT=1
#
# Power management for HD (hdparm -B values)
#
BATT_HD_POWERMGMT=254
LM_AC_HD_POWERMGMT=254
NOLM_AC_HD_POWERMGMT=254
However, even after doing a systemctl restart laptop-mode-tools.service I always get
$ sudo hdparm -B /dev/sda
/dev/sda:
APM_level = 96
Setting it manually works:
$ sudo hdparm -B 254 /dev/sda
/dev/sda:
setting Advanced Power Management level to 0xfe (254)
APM_level = 254
$ sudo hdparm -B /dev/sda
/dev/sda:
APM_level = 254
Of course, the settings are lost upon rebooting in this case.
Any idea where the problem could be?
Last edited by rggjan (2012-10-08 12:25:04)
Offline
Now that you mention it, I'm experiencing the same problem
Offline
I just checked it, no problem here. Running pure systemd, if that makes a difference...
Offline
Pure systemd here, too...
Offline
Turns out my problem was different: laptop-mode does set the values correctly but it wasn't being reloaded after a resume due to the pm-utils HOOK_BLACKLIST="hal-cd-polling intel-audio-powersave journal-commit laptop-mode pcie_aspm readahead sata_alpm sched-powersave xfs_buffer wireless" matching the 99laptop-mode file in sleep.d.
Removed laptop-mode from the blacklist and now I can keep my hdparm -B value consistently on 254
Offline
I just found the problem here, too. Just sent this Mail to the author:
I'm using your laptop-mode tools on an up-to-date archlinux system. The problem when switching to systemd is the following:
I have set the following settings in the configuration:
CONTROL_HD_POWERMGMT=1
BATT_HD_POWERMGMT=254
LM_AC_HD_POWERMGMT=254
NOLM_AC_HD_POWERMGMT=254
upon startup, they are correctly applied (hdparm -B 254). However, when suspending the laptop with pm-tools and waking it up again, hdparm -B shows me the default values of 96 instead of 254. This setting should be reapplied by laptop-mode-tools. There is actually this file: /usr/lib/pm-utils/sleep.d/01laptop-mode that handles it. When using systemd, however, this is NOT applied. Therefore, a custom systemd sleep hook is probably needed in /usr/lib/systemd/system-sleep/example.sh, as described here: https://wiki.archlinux.org/index.php/Systemd
This could be as simple as the following file (just tested it):
cat /usr/lib/systemd/system-sleep/laptop-mode.sh
#!/bin/sh
case "$1" in
pre )
;;
post )
/usr/sbin/laptop_mode force
;;
esac
Offline
With the latest laptop-mode-tools (which claims to support systemd) I can't get this fixed even after applying rggjan's workaround… I don't have anything in /etc/pm/config.d, so there should be no HOOK_BLACKLIST defined.
Offline
In my case, rggjan's sollution solved the problem that occured after suspend. But I still have a problem when I astarting my laptop. Laptop-mode starts or does not start quite ramdomly. I have LVM so I thought that delaying the start of laptop-mode.service until after lvm.service has been started would help. It didn't.
Perhaps this should be a separate forum topic.
Offline
I'm also experiencing the same problem. And:
1) it happens when I do a fresh boot;
2) I dont have any files in /etc/pm/config.d/
Offline
I apologize if it is bad style to answer to a post marked as [solved] but:
Same problem here!
HDParm-settings are not applied on boot by LMT.
laptop-mode.conf:
# Should laptop mode tools control the hard drive power management settings?
#
# Set to 0 to disable
CONTROL_HD_POWERMGMT="auto"
#
# Power management for HD (hdparm -B values)
#
BATT_HD_POWERMGMT=100
LM_AC_HD_POWERMGMT=200
NOLM_AC_HD_POWERMGMT=254
# hdparm -B /dev/sda
/dev/sda:
APM_level = 96
Any ideas or solutions on this so far?
And why is this post marked as 'solved'?
edit:
1.) manual set hdparm-settings survive reboot but not suspend!
2.) no difference between CONTROL_HD_POWERMGMT="auto" or "1"
3.)
# systemctl status laptop-mode
laptop-mode.service - Laptop Mode Tools
Loaded: loaded (/usr/lib/systemd/system/laptop-mode.service; enabled)
Active: active (exited) since Do 2013-01-24 14:05:20 CET; 8min ago
Process: 664 ExecStart=/usr/sbin/laptop_mode init auto (code=exited, status=0/SUCCESS)
4.) pointed out that this seems to be a bug: https://bugs.archlinux.org/task/33262 as systemd does not restore apm values on wake up.
Last edited by renegat (2013-03-09 11:01:42)
Offline
I think I may have found the solution for the suspend problem: open
/lib/udev/rules.d/99-laptop-mode.rules
and change the
lmt-udev auto
lines to
lmt-udev auto force
Offline
This worked for me. Thank you, andreyv!
What does 'force' do in these situations? If i'm not wrong, it is from this bit of the manual:
" Specify force as the second parameter to force laptop_mode to re-apply a state even if the computer is already in that state. These are
the values that are allowed for cmd :
"
Offline
What does 'force' do in these situations? If i'm not wrong, it is from this bit of the manual:
" Specify force as the second parameter to force laptop_mode to re-apply a state even if the computer is already in that state. These are
the values that are allowed for cmd :
"
Yes, it's this parameter. When suspend occurs, the AC/battery state doesn't change, so laptop-mode-tools think that nothing should be done. But with "force" we force it to set all settings anyway.
Offline