Jump to content

Disable External Power Button No Longer Working Under 6.10 Stable


Go to solution Solved by hku2,

Recommended Posts

I had a similar solution to this thread where I have modified version of the acpi_handler.sh file copy at boot (via a command in the GO file) where the majority of the lines have been commented out.  This was working great up until I upgraded to 6.10 stable from 6.09 (this issue exists in 6.10.1 as well).  I was cleaning my Unraid server chassis, which is a mid-tower enclosure with a flush-mount power button on the top, and accidentally pressed it (briefly and not a long press).  To my surprise, this initiated a shutdown of the server instead of being ignored. I confirmed that the CP command is still working and the acpi_handler.sh remains commented-out (see screenshot below).  However, it is no longer functioning as intended.  Therefore, I wanted to see if the external power button (ACPI event) is being handled differently under this new release and if I have to implement a new workaround/fix for it.

 

image.png.0c06da9a227dd0dc7c0f18859c8f986c.png

 

image.png.f4de4c023b5cf1b8579c95783ed4ec58.png

 

Any/all help is appreciated.  Thanks in advance.

Edited by MarkRMonaco
Link to comment

Just as a test, I also tried to implement the solution that was previously mentioned in that thread by commenting out my CP command and replacing it with the MV.  This has resulted the same way, once the external power button is pressed on the chassis, it will initiate a shutdown command of the server.  So, it appears that this file is not even utilized at all under this release.

 

image.png.cef875f598d67d85b44d2835929c1a6a.png

 

image.png.2ca2e014a55e462ca116c11092e51773.png

Link to comment
  • 5 months later...

Hi Mark,

 

You can kill "acpid" and have the short press ignored completely. Of course you could kill it automatically at start-up using /boot/config/go. Don't know if there is a better option but that should work.

 

vi /boot/config/go

Press i for insert

#!/bin/bash
killall acpid


Press ESC and :!wq or :x to save and quit vi/vim

 

 

Of course you could first test the command.

 

killall acpid

 

I myself am thinking of removing the button or using another button as my one year old loves turning off my Unraid server.

 

Please let us know if that works for you!

Edited by Duncan77
Link to comment
On 11/2/2022 at 6:20 AM, Duncan77 said:

Hi Mark,

 

You can kill "acpid" and have the short press ignored completely. Of course you could kill it automatically at start-up using /boot/config/go. Don't know if there is a better option but that should work.

 

vi /boot/config/go

Press i for insert

#!/bin/bash
killall acpid


Press ESC and :!wq or :x to save and quit vi/vim

 

 

Of course you could first test the command.

 

killall acpid

 

I myself am thinking of removing the button or using another button as my one year old loves turning off my Unraid server.

 

Please let us know if that works for you!

 

I just got around to testing this under the 6.11.2 & 6.11.3 releases by running the "killall acpid" command from the terminal, and then running it a 2nd time to make sure it was still not running).  However, in both cases (versions), it still allowed the system to shutdown when the physical button was pressed (single press and not held down).

Edited by MarkRMonaco
Link to comment
14 hours ago, MarkRMonaco said:

 

I just got around to testing this under the 6.11.2 & 6.11.3 releases by running the "killall acpid" command from the terminal, and then running it a 2nd time to make sure it was still not running).  However, in both cases (versions), it still allowed the system to shutdown when the physical button was pressed (single press and not held down).

 

That is unfortunate. The only option that I can think of is changing the BIOS setting. With my AORUS X570 the Power Button press option has two choices. 1. Shutdown immediately or 2. Long press 4 seconds.

The only option after that is making a hardware change like moving the button elsewhere.

Link to comment
13 minutes ago, MarkRMonaco said:

Unfortunately, I'm running an older MSI X470 board and it doesn't have that as an option (unless somehow I've missed it).  I'll just have to deal with it for now since I don't want to relocate the button.

Me too with my 1 year old. He is even smart enough to long press for four seconds... :'(. I will keep an eye out and when I find something I will let you know!

Link to comment

I hear that.  Thankfully, my kids are older.

 

Even though the power button is flush on the top of my case, I still occasionally manage to press it on accident (briefly, but is enough to invoke the safe shutdown process in Unraid).  Especially, if I am wiping it down from dust...

Edited by MarkRMonaco
Link to comment
  • Solution

Here's how I disabled it on my server (v6.11.3):
I added the following in my /boot/config/go file, but you can achieve it in a number of different ways, (e.g. through a user script):

# ignore power button
sed -i 's/#HandlePowerKey=poweroff/HandlePowerKey=ignore/' /etc/elogind/logind.conf
sed -i 's/power) \/sbin\/init 0/power) logger "POWER BUTTON pressed. Ignoring."/' /etc/acpi/acpi_handler.sh
/etc/rc.d/rc.elogind restart
/etc/rc.d/rc.acpid restart

 

Edited by hku2
Link to comment
On 11/11/2022 at 2:08 AM, hku2 said:

Here's how I disabled it on my server (v6.11.3):
I added the following in my /boot/config/go file, but you can achieve it in a number of different ways, (e.g. through a user script):

# ignore power button
sed -i 's/#HandlePowerKey=poweroff/HandlePowerKey=ignore/' /etc/elogind/logind.conf
sed -i 's/power) \/sbin\/init 0/power) logger "POWER BUTTON pressed. Ignoring."/' /etc/acpi/acpi_handler.sh
/etc/rc.d/rc.elogind restart
/etc/rc.d/rc.acpid restart

 

This seems to work. Changed the 4+ seconds power off press to instant-off in the BIOS and on power button press the system catches the button press and logs this action in /var/log/syslog.

Link to comment
  • 1 year later...
Posted (edited)
On 11/10/2022 at 7:08 PM, hku2 said:

Here's how I disabled it on my server (v6.11.3):
I added the following in my /boot/config/go file, but you can achieve it in a number of different ways, (e.g. through a user script):

# ignore power button
sed -i 's/#HandlePowerKey=poweroff/HandlePowerKey=ignore/' /etc/elogind/logind.conf
sed -i 's/power) \/sbin\/init 0/power) logger "POWER BUTTON pressed. Ignoring."/' /etc/acpi/acpi_handler.sh
/etc/rc.d/rc.elogind restart
/etc/rc.d/rc.acpid restart

 

I don't know how I missed this reply nearly two years ago, but I'm hoping that it will still work for v6.12.10.

 

I will add it now to my GO file, reboot, and report back with the results...

Edited by MarkRMonaco
  • Like 2
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...