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



  • I noticed that pfSense starts the shutdown procedure when
    pressing down the computer power button.
    I could not find the same directory+file that Redhat FC5 has
    for controlling what to do when a event occurs.
    In ClarkConnect the power button is disabled by default.

    How does one tell pfSense to do the same, to ignore a
    accidental pressing down of the power button?



  • You'll need to disable ACPI for this IIRC.

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



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



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



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



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



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



  • Nice!

    hoba pets the cat  ;D



  • 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>



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



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


Log in to reply