0

In an effort to weed out an acpi problem, I need to set all the /proc/acpi/wakeup device variables to disabled.

For the time being I'm doing it with acpitool and a script in /etc/rc.local ...

usr/bin/acpitool -W 1 && usr/bin/acpitool -W 2 && usr/bin/acpitool -W 3 && usr/bin/acpitool -W 5 && usr/bin/acpitool -W 6 && usr/bin/acpitool -W 7 && usr/bin/acpitool -W 8 && usr/bin/acpitool -W 9

... which works but is really ugly and rough. =-/

Unfortunately the acpitool manfile has no indication on how to set multiple devices at the same time and it may not even be an option. Really don't know.

I've looked at the possibility of changing the settings in sysctl as explained in this post, but sysctl -a does not show me any variable related to the devices I need to set to disabled ie: USBx and EUSB, or any of the other devices listed in /proc/acpi/wakeup for that matter.

How could I get this done in a more efficient manner?

This is all under Devuan ASCII.

0

Use a for loop. For example:

for i in $(seq 1 9)
do
    /usr/bin/acpitool -W $i
done

The seq 1 9 is actually a separate command that generates a series of numbers 1 2 3 4 5 6 7 8 9. The $( ... ) construct runs the enclosed command and uses its standard output as part of the command line. If you want/need to, you can just specify the numbers individually, making the first line of the loop be e.g. for i in 1 5 7 9.

  • Thanks a lot. I'll check this out and see how it works. I take it that the seq is not a range (1-9) but separate digits (1 5 7 9 ). – Groucho Apr 2 at 20:55
  • The seq 1 9 is actually a separate command that generates a series of numbers 1 2 3 4 5 6 7 8 9. The $( ... ) construct runs the enclosed command and uses its standard output as part of the command line. If you want/need to, you can just specify the numbers individually, making the first line of the loop be e.g. for i in 1 5 7 9. – telcoM Apr 2 at 20:59
  • It worked perfectly. Now, if I understand correctly, using acpitool would be the equivalent of command line echo $usbx > /proc/acpi/wakeup but with an application. I have been wondering just where – Groucho Apr 2 at 23:57
  • ... the seetings reflected in /proc/acpi/wakeup come from.Thought I'd have to specify just the device numbers to be disabled but it worked, either acting only on the enabled ones or setting them all to disabled (not the same thing I think) but the result is the intended one. Thank you for taking the time to explain it, now I have to study some bash. – Groucho Apr 3 at 0:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.