MarkRMonaco Posted May 23, 2022 Share Posted May 23, 2022 (edited) 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. Any/all help is appreciated. Thanks in advance. Edited May 23, 2022 by MarkRMonaco Quote Link to comment
MarkRMonaco Posted May 23, 2022 Author Share Posted May 23, 2022 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. Quote Link to comment
Duncan77 Posted November 2, 2022 Share Posted November 2, 2022 (edited) 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 November 2, 2022 by Duncan77 Quote Link to comment
MarkRMonaco Posted November 2, 2022 Author Share Posted November 2, 2022 Thanks. I'll give that a shot when I get a chance and will let you know. 1 Quote Link to comment
MarkRMonaco Posted November 9, 2022 Author Share Posted November 9, 2022 (edited) 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 November 9, 2022 by MarkRMonaco Quote Link to comment
Duncan77 Posted November 9, 2022 Share Posted November 9, 2022 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. Quote Link to comment
MarkRMonaco Posted November 9, 2022 Author Share Posted November 9, 2022 (edited) 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. Edited November 9, 2022 by MarkRMonaco Quote Link to comment
Duncan77 Posted November 9, 2022 Share Posted November 9, 2022 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! Quote Link to comment
MarkRMonaco Posted November 9, 2022 Author Share Posted November 9, 2022 (edited) 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 November 9, 2022 by MarkRMonaco Quote Link to comment
Solution hku2 Posted November 11, 2022 Solution Share Posted November 11, 2022 (edited) 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 November 12, 2022 by hku2 Quote Link to comment
Duncan77 Posted November 12, 2022 Share Posted November 12, 2022 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. Quote Link to comment
MarkRMonaco Posted July 11 Author Share Posted July 11 (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 July 11 by MarkRMonaco 2 Quote Link to comment
MarkRMonaco Posted July 11 Author Share Posted July 11 @hku2, I'm very happy to report that this still works under v6.12.10. I just wish I saw the post back in 2022. 2 Quote Link to comment
Recommended Posts
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.