power management scripts should respect hdparm.conf
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
acpi-support (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
On Ubuntu Feisty, there are several power management scripts that do not honor what the user might have defined in hdparm.conf.
For instance, in my case, my hardrive had a factory setting for the hard drive head parking that was too agressive. So I resorted to hdparm.conf:
dev/sda {
apm = 224
}
and used update-rc.d hdparm defaults to apply those settings at boot. Since I also use laptop-mode, I was also carefull enough to specify CONTROL_
But I began noticing that after a suspend or hibernation, these settings were no longer being used. After some researching I discovered that the script /etc/power.sh had the following lines:
function laptop_mode_enable {
$LAPTOP_MODE start
for x in /sys/bus/
$HDPARM -S 12 /dev/$drive 2>/dev/null
$HDPARM -B 1 /dev/$drive 2>/dev/null
done
for x in /sys/bus/
$HDPARM -S 12 /dev/$drive 2>/dev/null
$HDPARM -B 1 /dev/$drive 2>/dev/null
done
}
function laptop_mode_disable {
for x in /sys/bus/
$HDPARM -S 0 /dev/$drive 2>/dev/null
$HDPARM -B 255 /dev/$drive 2>/dev/null
done
for x in /sys/bus/
$HDPARM -S 0 /dev/$drive 2>/dev/null
$HDPARM -B 255 /dev/$drive 2>/dev/null
done
$LAPTOP_MODE stop
}
This is inconsistent behavior, because this script decides unilaterally on hdparm settings (which by the way are too aggressive, at least for my hd), without honoring the laptop-mode and hdparm configurations.
To solve my problem I simply removed the hdparm commands from power.sh and all was well again. But I should not have to do this.
There are other scripts that also do not respect hdparm.conf. For instance a simple grep hdparm /usr/share/
cmd = "hdparm -B1 /dev/"+disk+" > /dev/null"
cmd = "hdparm -B255 /dev/"+disk+" > /dev/null"
Once again it is using hardcoded hdparm settings instead of relying on hdparm.conf. But since this script has not given me any problem I have not inspected it further to see if power-guidance has a legit reason to behave this way.
Sorry if I was not clear in my explanation. Thank you reading my bug report.
Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in recently. We were wondering if this is still an issue for you? Thanks in advance.