Comment 9 for bug 74394

Fixing hdparm parameter value and laptop-mode issue on resume

Bug : when resuming from suspend laptop-mode.conf setting are not respected

Consequences : the same as in the previous case : laptop-mode.conf settings are not applied

Cause : nothing is done concerning laptop-mode during resume.

False solution ?? : I'm using pm-utils, and when I add SERVICES="laptop-mode" in "/etc/acpi/acpi-support", it doesnt't help, I don't understand why (laptop-mode should be restarted on resume).
But, It seem to work (SERVICES="laptop-mode") when using "/etc/apci/ force" (so It may work using default suspend function of gnome?...)


Real solutions :
With solution 1 and 2, you have to be carreful to the script, which has also to be modified.
With solution 3, nothing has to be done to (but see previous post...)


Solution 1 : when using pm-utils, the following script can be added :
(proposed by Valentin :

2. cd /usr/lib/pm-utils/sleep.d
3. sudo gedit
4. paste this:

if [ "$?" -eq 0 ]; then
 echo "BATTERY" > /var/lib/acpi-support/powerstate
 /etc/acpi/ ac_adapter
 if [ "$?" -eq 1 ]; then
  echo "AC" > /var/lib/acpi-support/powerstate
  /etc/acpi/ battery

5. save & close
6. sudo chmod 755


Solution 2 : using the default suspend of gnome (script /etc/apci/ ?) :
Adding the same script in : /etc/acpi/resume.d/ (and maybe /etc/acpi/suspend.d/)


Solution 3 : using the default suspend of gnome (script /etc/apci/ ?) :
Adding a script called (for example) "" in the following directories:
which simply contains hdparm setting :
hdparm -B 255 /dev/sda

BUT : with this solution no difference is done between AC and battery on resume (concerning hdparm setting)

Solution 1 work fine for me combined with the script I proposed in the previous post.