Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Prevent shutdown when pressing the power button

    Scheduled Pinned Locked Moved Hardware
    7 Posts 5 Posters 1.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jkiel
      last edited by jkiel

      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.

      1 Reply Last reply Reply Quote 0
      • johnpozJ
        johnpoz LAYER 8 Global Moderator
        last edited by johnpoz

        And why would you want to do this? Just curious..

        Do you have little kids around your router that like to push buttons?

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 24.11 | Lab VMs 2.8, 24.11

        1 Reply Last reply Reply Quote 0
        • stephenw10S
          stephenw10 Netgate Administrator
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • J
            jkiel
            last edited by

            @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.

            1 Reply Last reply Reply Quote 0
            • chpalmerC
              chpalmer
              last edited by

              Glue a bottle cap over the button.. :)

              Triggering snowflakes one by one..
              Intel(R) Core(TM) i5-4590T CPU @ 2.00GHz on an M400 WG box.

              1 Reply Last reply Reply Quote 0
              • J
                jkiel
                last edited by jkiel

                A sysctl setting is a little easier than messing around with glue. ;)

                1 Reply Last reply Reply Quote 0
                • luckman212L
                  luckman212 LAYER 8
                  last edited by

                  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! 👍

                  93838b45-f0a1-4de5-aec1-6a88ae271767-image.png

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.