#818649 power.d scripts are not run at all

#818649#5
Date:
2016-03-18 13:30:07 UTC
From:
To:
Hi

The scripts in /usr/lib/pm-utils/power.d are not run at all when power
is plugged or unplugged. If I understand this correctly upower used to
call pm-powersave but the code to do this was removed in recent
versions. For some time there was a --enable-deprecated switch to upower
which was used in Debian, but the corresponding code has been removed
from upower.

acpid also calls pm-powersave from /etc/acpi/power.sh, but checks for
upower before doing this. So as long as upower is running this does not
work either. But the jessie release notes [1] recommend to uninstall
acpid if using logind (which is probably used on most laptop system).

I don't have a good suggestion on how to fix this, but IMO this should
be at least documented somewhere in the package and the scripts should
be removed if they are no longer executed by anything.

Another option would be to add a udev rule like suggested in the Arch
wiki. [2]

Feel free to reassign this bug to a more appropriate package.

Gaudenz

[1]
https://www.debian.org/releases/stable/amd64/release-notes/ch-information.en.html#idp36451200

[2]
https://wiki.archlinux.org/index.php/Power_management#Using_a_script_and_an_udev_rule

#818649#10
Date:
2016-03-22 13:11:08 UTC
From:
To:
[Gaudenz Steinlin]

I've just noticed this too.  It affect my battery-stats package, which
want to record the battery status when the power plug is inserted and removed.

I've been unable to find a functioning workaround, and ended up running the
collector from cron every 10 minutes instead. :(

Please make the power.d scripts run again. :)

#818649#15
Date:
2021-04-11 15:27:21 UTC
From:
To:
I'm not sure why this only hit me after upgrading to bullseye, but it
did.

For now, I've fixed it by adding two custom rules to udev (perhaps
dump them into 10_pm-utils-local.rules):

  ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains",\
    ATTR{online}=="1", RUN+="/usr/sbin/pm-powersave false"
  ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains",\
    ATTR{online}=="0", RUN+="/usr/sbin/pm-powersave true"

It clearly would be great if this could somehow be added to the
package, though of course I have no idea how this would interact with
upower or systemd.

It does co-operate nicely with tlp (wearing their upstream down do
allow custom hook scripts would be an attractive alternative, though).

#818649#20
Date:
2023-12-21 17:56:09 UTC
From:
To:
Dear submitter,

as the package pm-utils has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/1058701

The version of this package that was in Debian prior to this removal
can still be found using https://snapshot.debian.org/.

Please note that the changes have been done on the master archive and
will not propagate to any mirrors until the next dinstall run at the
earliest.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Thorsten Alteholz (the ftpmaster behind the curtain)