# How do I make my power button do nothing with ACPI disabled?



## GullibleJones (Nov 19, 2008)

Due to my laptop's buggy BIOS, I have to disable ACPI or my network card won't work.

However, this introduces a problem with my power button. With ACPI enabled, the power button induces a clean shutdown. With ACPI disabled, however, instead of just not doing anything, pressing it causes the laptop to immediately power down, i.e. an unclean shutdown. 

Needless to say, this is very bad, as a single wrong touch can immediately crash my machine, and potentially cause filesystem damage. Is there any way to tell FreeBSD to completely ignore the power button?

(FWIW: no, I don't need the unclean-shutdown functionality; after five seconds of holding the power button down, my laptop's BIOS kicks in and automatically shuts it down.)


----------



## gelraen (Nov 19, 2008)

When ACPI is disabled hardware works in legacy mode. So you only may try to use apm(4) instead of ACPI, but be sure to read "BUGS" section in manual.

Also, if some BIOS updates available at manufacturer's site, updating may help.


----------



## aragon (Nov 20, 2008)

The way you word it is as if FreeBSD is performing the unclean shutdown in response to a power button event.  But I didn't know FreeBSD was capable of shutting down uncleanly (unless the kernel crashes, of course).  Are you sure it's not just your BIOS shutting down the hardware?


----------



## brucec@ (Nov 20, 2008)

aragon said:
			
		

> The way you word it is as if FreeBSD is performing the unclean shutdown in response to a power button event.  But I didn't know FreeBSD was capable of shutting down uncleanly (unless the kernel crashes, of course).  Are you sure it's not just your BIOS shutting down the hardware?



In this case the power button is being reconfigured to switch the power supply off without sending a signal to the OS. However, see shutdown(8) and the -n option for how to tell FreeBSD to do a real unclean shutdown


----------



## cliedo (Nov 21, 2008)

you may want to try this website: http://linuxgazette.net/106/pramode.html
I give credit to the author its not mine  
then go from there hint ps


----------



## GullibleJones (Nov 21, 2008)

brucec said:
			
		

> In this case the power button is being reconfigured to switch the power supply off without sending a signal to the OS. However, see shutdown(8) and the -n option for how to tell FreeBSD to do a real unclean shutdown



I know how to do a clean shutdown... How do I tell FreeBSD to do that when I press the power button?

(Keep in mind that ACPI is disabled.)


----------



## Nicholas (Dec 5, 2008)

did you tried 
sysctl hw.acpi.power_button_state=NONE ?
know, acpi is disabled, but my laptop works with acpi enabled only so i can't check my guess.


----------



## brucec@ (Dec 5, 2008)

GullibleJones said:
			
		

> I know how to do a clean shutdown... How do I tell FreeBSD to do that when I press the power button?
> 
> (Keep in mind that ACPI is disabled.)



The only option is to see if you can enable APM instead or upgrade the BIOS so you can re-enable ACPI.  If the BIOS doesn't configure the power button to route the button event to FreeBSD there's nothing it can do to prevent the power being lost.


----------



## GullibleJones (Apr 9, 2009)

*How to override default power button behavior when ACPI is off?*

I'm currently eyeing FreeBSD as an alternative to the numerous and largely crappy Linux distros out there. However, I have a problem with it... Since enabling ACPI on FreeBSD disables networking on my laptop, I have to use FreeBSD without ACPI. (This isn't a big deal; the laptop is already pretty much a desktop replacement.) However, when ACPI is off, pressing the power button instantly and uncleanly shuts down my machine; so, accidentally touching the button could result in data loss, something I'm not interested in. Is there a way to stick something between the BIOS and the power button so that this doesn't happen, without enabling ACPI (and thus disabling my networking) or APM (which I don't have)?


----------



## GullibleJones (Apr 9, 2009)

Argh, I forgot that I already asked this question. Never mind.


----------

