Prevent shutdown when pressing the power button
-
Couldn't find a bios option to disable the power button on the device I'm using to run pfsense, but I ran across this old thread explaining how to disable the power button in pfsense. Unfortunately those instructions wouldn't work.
However, what did work for me is, in case anyone is interested:
Diagnostics > Edit File
Path to file: /boot/loader.conf.local
Click Load to load the existing file, if there is one.Add the following:
hw.acpi.power_button_state=NONE
Save.
Reboot. -
And why would you want to do this? Just curious..
Do you have little kids around your router that like to push buttons?
-
Yeah, some devices have power buttons that are all too easy to press.
hw.acpi.power_button_state=NONE
is the correct way to disable it but you can enter that as a sysctl it doesn't have to be a loader varible. That way it is saved in the config.Steve
-
@stephenw10 said in Prevent shutdown when pressing the power button:
you can enter that as a sysctl it doesn't have to be a loader varible. That way it is saved in the config.
Thanks for tip!
@johnpoz said in Prevent shutdown when pressing the power button:
And why would you want to do this? Just curious..
Do you have little kids around your router that like to push buttons?
I actually do have a rambunctious little toddler that likes to push all kinds of buttons, both figuratively and literally. But in this case it's to prevent anyone, including myself, from accidentally pressing the power button when fumbling with other equipment near the router. Much like the ONT, Switch, Access Point and VoIP Gateway it's installed next to lack momentary power buttons to prevent this very thing.
-
Glue a bottle cap over the button.. :)
-
A sysctl setting is a little easier than messing around with glue. ;)
-
Just came here to say thanks for this tip. My wife has on more than one occasion accidentally hit the power button while moving stuff around in our closet and caused our SG-5100 to promptly shut down. Grr!
I used the System Tunable method. Problem solved!