The officially official Devuan Forum!

You are not logged in.

#1 2019-03-31 22:22:16

Altoid
Member
Registered: 2017-05-07
Posts: 1,429  

[Solved] Editing /proc/acpi/wakeup

Hello:

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

Like this:

groucho@devuan:~$ acpitool -w
   Device	S-state	  Status   Sysfs node
  ---------------------------------------
  1. USB0	  S4	*disabled  pci:0000:00:1d.0
  2. USB1	  S4	*disabled  pci:0000:00:1d.1
  3. USB2	  S4	*disabled  pci:0000:00:1d.2
  4. USB5	  S4	*disabled
  5. EUSB	  S4	*disabled  pci:0000:00:1d.7
  6. USB3	  S4	*disabled  pci:0000:00:1a.0
  7. USB4	  S4	*disabled  pci:0000:00:1a.1
  8. USB6	  S4	*disabled  pci:0000:00:1a.2
  9. USBE	  S4	*disabled  pci:0000:00:1a.7
  10. P0P1	  S4	*disabled  pci:0000:00:01.0
  11. P0P2	  S4	*disabled  pci:0000:00:06.0
  12. P0P3	  S4	*disabled  pci:0000:00:1c.0
  13. BR11	  S4	*disabled
  14. BR12	  S4	*disabled
  15. BR13	  S4	*disabled
  16. P0P4	  S4	*disabled  pci:0000:00:1c.4
  17. BR15	  S4	*disabled
  18. P0P5	  S4	*disabled  pci:0000:00:1e.0
  19. GBE	  S4	*disabled  pci:0000:00:19.0
  20. SLPB	  S4	*disabled
groucho@devuan:~$ 

As doing it via terminal lasts only till the next reboot, for the time being I'm doing it with 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

Now this is really not an elegant way to do this (running the same instruction eight times with a different variable each time!) something which is clearly reflected as the output rolls off the screen although for some reason it is not getting logged anywhere.

The man file does not indicate how to set multiple devices at once.

I understand there's also the proper way to do this: with a *.conf file in the /etc/sysctl.d directory.

groucho@devuan:~$ cat /etc/sysctl.d/README.sysctl
Kernel system variables configuration files

Files found under the /etc/sysctl.d directory that end with .conf are parsed within sysctl(8) at boot time.  If you want to set kernel variables you can either edit /etc/sysctl.conf or make a new file.

The filename isn't important, but don't make it a package name as it may clash with something the package builder needs later. It must end with .conf though.

My personal preference would be for local system settings to go into /etc/sysctl.d/local.conf but as long as you follow the rules for the names of the file, anything will work. See sysctl.conf(8) man page for details of the format.
groucho@devuan:~$ 

I cannot figure out the syntax and cannot find any examples on line.

Anyone know how to do this?

Thanks in advance.

A.

Edit 01/04/19
Dir name correction

Last edited by Altoid (2019-04-03 14:48:47)

Offline

#2 2019-04-01 18:37:02

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [Solved] Editing /proc/acpi/wakeup

I could be wrong here but I think sysctl can only be used for settings under /proc/sys:

alpine:~$ sysctl acpi.wakeup
sysctl: cannot stat /proc/sys/acpi/wakeup: error code 2
alpine:~255$

So a startup script is the "correct" solution.


Brianna Ghey — Rest In Power

Offline

#3 2019-04-02 02:05:52

Altoid
Member
Registered: 2017-05-07
Posts: 1,429  

Re: [Solved] Editing /proc/acpi/wakeup

Hello:

Head_on_a_Stick wrote:

I could be wrong here but ...

There's a post here https://unix.stackexchange.com/question … 417_417965 that may indicate that you are right ...

/proc/acpi/wakeup is not a child of /proc/sys, sysctl doesn't work here.

... but it's over my pay grade, no idea how that works. =-/

Head_on_a_Stick wrote:

... script is the "correct" solution.

Yes, the script is a solution and the one I'm using works but it's awfull.

If I cannot find a way for the command acpitool -W to address multiple entries in /proc/acpi/wakeup at once, I need a more complex script ie: with a minimum of elegance to do it with.

Any idea where I can get a sample script to modify from?

Thanks in advance.

A.

Offline

#4 2019-04-02 06:10:37

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [Solved] Editing /proc/acpi/wakeup

Rather than use acpitool you can echo the desired values into /proc/acpi/wakeup directly.

Found this: https://askubuntu.com/questions/152403/ … -permanent


Brianna Ghey — Rest In Power

Offline

#5 2019-04-02 11:35:10

Altoid
Member
Registered: 2017-05-07
Posts: 1,429  

Re: [Solved] Editing /proc/acpi/wakeup

Hello:

Head_on_a_Stick wrote:

Rather than use acpitool ...

Indeed ...

That's the first option I came across when I started with this but I was at odds with the posted script because (as I understand it) it activates when the machine is going into suspend, which my machine will not do as I have turned off all PM options.

It's a Sun Ultra 24 with a buggy BIOS (last version available) and ACPI issues so as part of the intended fix, I have deactivated all PM features.

When I found sysctl (which does not work with /proc/sys) and then acpitool, I went with the latter as it did work and seemed rather more straightforward, albeit with my very clumsy script. 

I'll look into the posted script again and see if I can bash out a modification. (pun intended).  =-)

Thanks a lot for your input.

Cheers,

A.

Offline

#6 2019-04-03 14:48:01

Altoid
Member
Registered: 2017-05-07
Posts: 1,429  

Re: [Solved] Editing /proc/acpi/wakeup

Hello:

Altoid wrote:

... if I can bash out a modification.

It would seem that acpitool is just an application that writes to /proc/acpi/wakeup, just like you would do by using echo. 

Found a helping hand at Stack Overflow and put this script to execute at boot (in rc.local)

#!/bin/sh
# set /proc/acpi/wakeup to disabled with acpitool

PATH=/sbin:/bin:/usr/sbin:/usr/bin:

for i in $(seq 1 9)
do
    /usr/bin/acpitool -W $i
done
groucho@devuan:~$ 

This is the result, sleep to all input devices seen by acpitool set to disabled:

$ acpitool -w
   Device	S-state	  Status   Sysfs node
  ---------------------------------------
  1. USB0	  S4	*disabled  pci:0000:00:1d.0
  2. USB1	  S4	*disabled  pci:0000:00:1d.1
  3. USB2	  S4	*disabled  pci:0000:00:1d.2
  4. USB5	  S4	*disabled
  5. EUSB	  S4	*disabled  pci:0000:00:1d.7
  6. USB3	  S4	*disabled  pci:0000:00:1a.0
  7. USB4	  S4	*disabled  pci:0000:00:1a.1
  8. USB6	  S4	*disabled  pci:0000:00:1a.2
  9. USBE	  S4	*disabled  pci:0000:00:1a.7
  10. P0P1	  S4	*disabled  pci:0000:00:01.0
  11. P0P2	  S4	*disabled  pci:0000:00:06.0
  12. P0P3	  S4	*disabled  pci:0000:00:1c.0
  13. BR11	  S4	*disabled
  14. BR12	  S4	*disabled
  15. BR13	  S4	*disabled
  16. P0P4	  S4	*disabled  pci:0000:00:1c.4
  17. BR15	  S4	*disabled
  18. P0P5	  S4	*disabled  pci:0000:00:1e.0
  19. GBE	  S4	*disabled  pci:0000:00:19.0
  20. SLPB	  S4	*disabled
$ 

Cheers,

A.

Last edited by Altoid (2019-04-03 14:53:39)

Offline

Board footer