[Pm-utils] Bug? in pm-powersave

Robby Workman rw at rlworkman.net
Sun Jan 2 22:35:02 PST 2011

Hi Victor and list,

I think I've encountered a bug in pm-powersave, or maybe it's
a bug in how the powersave hooks are processed, or perhaps I'm
just being braindead ;-) but here's a summary:

My laptop drive doesn't like the default DRIVE_POWER_MGMT_BAT
value of "1" - it goes to sleep every 30 seconds and causes
a delay of 1-2 seconds that makes the system feel like it's
crawling along.  

From pm-powersave(8):
       /etc/pm/power.d/, /usr/lib/pm-utils/power.d/
           When you run pm-powersave it combines the scripts in 
           these two directories and executes them in sorted order.
           If both directories contain a script with the same name,
           the one in /etc/pm/power.d/ has a higher precedence and 
           only this one will be executed.

Therefore, I grabbed $libdir/pm-utils/power.d/harddrive, placed
a copy at /etc/pm/power.d/harddrive, made sure it retained its
executable permissions, and edited it down to the following:

  [ -x /sbin/hdparm ] || exit $NA
  # Default devices to operate on

However, when I unplug the AC adapter (or run "pm-powersave true"
manually), the value shown with "hdparm -B /dev/sda" is not 128;
it stays at whatever it was previously.  /var/log/pm-powersave.log
shows this:

  Running hook /etc/pm/power.d/harddrive true:
  /etc/pm/power.d/harddrive true: success.

If I remove the /etc/pm/power.d/harddrive file completely, the 
value shown by hdparm afterward is the default value defined in
$libdir/pm-utils/power.d/harddrive, and this is what shows in 

  Running hook /usr/lib64/pm-utils/power.d/harddrive true:
  Enabling power management for /dev/sda...Done.
  /usr/lib64/pm-utils/power.d/harddrive true: success.

Am I doing something wrong, or is there a bug here?


More information about the Pm-utils mailing list