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

    Prevent shutdown/reboot when pressing the power button on the computer

    Scheduled Pinned Locked Moved Hardware
    11 Posts 3 Posters 7.9k 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.
    • S
      sullrich
      last edited by

      You'll need to disable ACPI for this IIRC.

      http://wiki.pfsense.com/wikka.php?wakka=BootOptions

      1 Reply Last reply Reply Quote 0
      • H
        hoba
        last edited by

        Or disconnect the powerbutton from the board. This should be pretty easy. Set your bios to autopoweron on power restore and you should be fine.

        1 Reply Last reply Reply Quote 0
        • V
          Veni
          last edited by

          I'm not sure if i have done it correctly, because now the computer simply shuts off right away, as if someone
          pulls the power cord.

          I put hint.acpi.0.disabled=1 into /boot/loader.conf and rebooted the computer.
          After it had finished reboot, i pressed the power button, and the computer "dies" right away, no delay, no shutdown, just dead :(.

          hoba,

          Or disconnect the powerbutton from the board. This should be pretty easy. Set your bios to autopoweron on power restore and you should be fine.

          that would do the trick, but i need something in front of the box to press for 4 seconds to force the computer to shutdown
          in case it gets stuck, and pulling the power cord to do so is not an option.

          1 Reply Last reply Reply Quote 0
          • H
            hoba
            last edited by

            Does your bios support options for the powerbutton of any kind? Also try disabling acpi and advanced powermanagement in the bios.

            1 Reply Last reply Reply Quote 0
            • V
              Veni
              last edited by

              The power part inside the BIOS only support things like, power restore behaviour,
              time(clock) when computer should autostart, if modem RING should start the computer and so on.

              There is for example no reference to any power management version that should be used, not even a harddrive spindown option.

              The PnP OS option is set to disabled.

              1 Reply Last reply Reply Quote 0
              • V
                Veni
                last edited by

                Found it, i think ;D.
                Had to add the following line to /etc/sysctl.conf:

                hw.acpi.power_button_state=S0

                Rebooted, tried to press the power button, and only got a message that something was not ready.
                It did atleast not shutdown the pfSense box while i pressed the power button :D.

                1 Reply Last reply Reply Quote 0
                • H
                  hoba
                  last edited by

                  Nice!

                  hoba pets the cat  ;D

                  1 Reply Last reply Reply Quote 0
                  • V
                    Veni
                    last edited by

                    I found a different way of changing the hw.acpi.power_button_state from the default S5 to S0.
                    It's possible to put the following line:

                    <shellcmd>/sbin/sysctl hw.acpi.power_button_state=S0;</shellcmd>

                    inside the file /cf/conf/config.xml

                    <port><maximumstates>15000</maximumstates>
                                    <disablenatreflection>yes</disablenatreflection>
                                    <shellcmd>/sbin/sysctl hw.acpi.power_button_state=S0;</shellcmd>
                                    <dnsallowoverride><interfaces><lan>and it works, but i still need to ask, is this good or bad compared to the sysctl.conf edit suggestion posted?

                    The advantage with the xml edit, is that the power button configuration will be restored in case some
                    one needs to restore pfSense settings from a backup file.</lan></interfaces></dnsallowoverride></port>

                    1 Reply Last reply Reply Quote 0
                    • S
                      sullrich
                      last edited by

                      @Veni:

                      I found a different way of changing the hw.acpi.power_button_state from the default S5 to S0.
                      It's possible to put the following line:

                      <shellcmd>/sbin/sysctl hw.acpi.power_button_state=S0;</shellcmd>

                      inside the file /cf/conf/config.xml

                      <port><maximumstates>15000</maximumstates>
                                      <disablenatreflection>yes</disablenatreflection>
                                      <shellcmd>/sbin/sysctl hw.acpi.power_button_state=S0;</shellcmd>
                                      <dnsallowoverride><interfaces><lan>and it works, but i still need to ask, is this good or bad compared to the sysctl.conf edit suggestion posted?

                      The advantage with the xml edit, is that the power button configuration will be restored in case some
                      one needs to restore pfSense settings from a backup file.</lan></interfaces></dnsallowoverride></port>

                      This is better as it will be backed up.

                      1 Reply Last reply Reply Quote 0
                      • V
                        Veni
                        last edited by

                        It feels like i've put the thread in the wrong forum, and if someone with the ability to
                        move it feels that it belongs in the hardware section, please feel free to do so.

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