FS#35853 - [pm-utils] power.d won't run

Attached to Project: Arch Linux
Opened by asfa (lockheed) - Wednesday, 19 June 2013, 18:14 GMT
Last edited by Jan de Groot (JGC) - Monday, 19 August 2013, 11:12 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Jan de Groot (JGC)
Architecture x86_64
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

I have pm-utils installed and upower and acpid services up and running.

I have am example script like this:
/etc/pm/power.d/00-brightness

----------------------
#!/bin/bash

case $1 in
true)
echo 1 > /sys/class/backlight/acpi_video*/brightness
;;
false)
echo 15 > /sys/class/backlight/acpi_video*/brightness
;;
esac

----------------------

But it won't run automatically.

It also won't run if I do this:
sudo /etc/pm/power.d/00-brightness

but it does run if I do
sudo /etc/pm/power.d/00-brightness true


There is no error in /var/log/pm-powersave.log
The /sys/class/power_supply/ is correct and contains AC BAT0




Additional info:
* package version(s)
newest available

* config and/or log files etc.

/var/log/pm-powersave.log:

/etc/pm/power.d/00-brightness true: success.
Running hook /etc/pm/power.d/01-dirty_values true:

/etc/pm/power.d/01-dirty_values true: success.
Running hook /usr/lib/pm-utils/power.d/hal-cd-polling true:

No errors

Steps to reproduce:
This task depends upon

Closed by  Jan de Groot (JGC)
Monday, 19 August 2013, 11:12 GMT
Reason for closing:  Not a bug
Comment by asfa (lockheed) - Wednesday, 19 June 2013, 18:15 GMT
And it's not just this script. I also have another one there, which doesn't run either:

/etc/pm/power.d/01-dirty_values
------------------
#!/bin/bash

case $1 in
true)
sleep 1 && echo 90 > /proc/sys/vm/dirty_ratio
sleep 1 && echo 1 > /proc/sys/vm/dirty_background_ratio
;;
false)
sleep 2 && echo 30 > /proc/sys/vm/dirty_ratio
sleep 2 && echo 10 > /proc/sys/vm/dirty_background_ratio
;;
esac

------------------
Comment by Dave Reisner (falconindy) - Wednesday, 19 June 2013, 20:50 GMT
> It also won't run if I do this:
> sudo /etc/pm/power.d/00-brightness
Your script does nothing when $1 is empty. What makes you think it doesn't run?

> echo 15 > /sys/class/backlight/acpi_video*/brightness
This is not a valid method of writing to multiple files with a single echo. You must use tee.
Comment by asfa (lockheed) - Wednesday, 19 June 2013, 22:46 GMT
>>>>> Your script does nothing when $1 is empty. What makes you think it doesn't run?
I don't know what you mean by empty $1.

>>>>> This is not a valid method of writing to multiple files with a single echo. You must use tee.
Yes, you are right. This was a typo, the actual script points to video0
Comment by Dave Reisner (falconindy) - Wednesday, 19 June 2013, 23:24 GMT
> I don't know what you mean by empty $1.
$1 is a positional parameter set, in this case, by passing an argument to the script. If you pass no argument, your case statement (which appears to be the entirety of the script) will do nothing.
Comment by asfa (lockheed) - Thursday, 20 June 2013, 07:01 GMT
Right, but how is it supposed to look like? This script it taken from Arch wiki, as seen here:
https://wiki.archlinux.org/index.php/Pm-utils
Comment by asfa (lockheed) - Thursday, 20 June 2013, 07:22 GMT
Isn't that the case that pm-powersave functions will call every script in /usr/lib/pm/power.d/ and /etc/pm-utils/power.d with "true" or "false" argument, so that shouldn't be the problem?
Comment by Leonid Isaev (lisaev) - Wednesday, 03 July 2013, 13:49 GMT
> /etc/pm/power.d/00-brightness true: success.
> Running hook /etc/pm/power.d/01-dirty_values true:
> /etc/pm/power.d/01-dirty_values true: success.

Your hooks are running... why do you claim otherwise? Try inserting something like "logger $(date -u)" in any of them and check your daemon.log of systemd-journal. Also, as falconindy said, fix your 00-brightness.

> I have pm-utils installed and upower and acpid services up and running.

Check your /etc/Upower/Upower.conf -- it calls pm-powersave whenever a power state changes (AC unplugged, etc.). But what does acpid has to do with your issue? Is it running any scripts?

Finally, please note that pm-utils upstream is pretty much dead, and it will probably soon disappear from arch.
Comment by asfa (lockheed) - Wednesday, 03 July 2013, 13:50 GMT
Yeah, I moved on to udev rules that work just fine.

Loading...