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
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
|
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
/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
------------------
> 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.
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
$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.
https://wiki.archlinux.org/index.php/Pm-utils
> 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.