# Keep FreeBSD to run, while the laptop is folded



## maulana23 (Aug 9, 2010)

Hi Everyone,


Usually, if you have an OS running in a laptop, if you fold the laptop, the system will be on hibernate state automatically. In my current state, If I fold my laptop and I re-open it again, the system will hang (mouse and keyboard are not running, it will be like a screenshot of the last desktop view).

My questions are:
1. How to set my system to be automatically go into hibernate state whenever the laptop is folded?

2. Is there anyway to set the system to keep running while the laptop is folded (and it wont hang whenever it's opened)?


My current system = FreeBsd 8.0-Release-p2
Laptop = Lenovo T61


Thank you


----------



## SirDice (Aug 9, 2010)

Try loading acpi_ibm(4).


----------



## maulana23 (Aug 9, 2010)

Thank you for your reply SirDice,

I have followed your instruction, the hotkey buttons are working, however the system still hangs (freeze) whenever the laptop is folded (closed)..

Is there any advice to solve this?

Thank you again in advance,..


----------



## loop (Aug 9, 2010)

Us Thinkpad users are the fortunate ones where ACPI (mostly) works. Have a look at the sysctl hw.acpi.lid_switch_state. If it's set to S3 the laptop will hibernate. Try setting that to S0 (I haven't tried this, and my T42 will be booted into windows for a while yet)


----------



## maulana23 (Aug 11, 2010)

Hi Loop, thanks for the reply,..

I've followed your instruction, it is still hang,.. I think it fails on resume,..


----------



## loop (Aug 12, 2010)

Have you tried setting the it in the BIOS? Power -> Suspend when LCD is closed -> select "no suspend"


----------



## maulana23 (Aug 16, 2010)

Hi Loop, thanks for your reply,..

does that mean I set the BIOS before going into system (FreeBSD) or inside the system? Can I get detail on how to do that?

Furthermore, I'd like to clarify my question,... How do I set FreeBSD to PREVENT it to suspend/hibernate?


Thank you in advance,..


----------



## loop (Aug 17, 2010)

maulana23 said:
			
		

> Hi Loop, thanks for your reply,..
> 
> does that mean I set the BIOS before going into system (FreeBSD) or inside the system? Can I get detail on how to do that?
> 
> ...



Yep, as you power on the laptop hit the F12 key and get into the BIOS settings.


----------



## Beastie (Aug 17, 2010)

Or F2 or Delete. It depends on the machine.


----------



## maulana23 (Aug 17, 2010)

Hi guys, thanks for your reply,..

I've finally found the solution to prevent suspend on my laptop,..

I added the following line to/etc/sysctl.conf


```
hw.acpi.suspend_state=NONE
```


----------



## DutchDaemon (Aug 17, 2010)

You may also have this one: 
	
	



```
hw.acpi.lid_switch_state
```


----------



## warudemaru (Aug 17, 2010)

Suspend/Resume should work with

```
kern.smp.disabled=1
```
in /boot/loader.conf you may also set it in loader command line


----------



## maulana23 (Aug 23, 2010)

DutchDaemon said:
			
		

> You may also have this one:
> 
> 
> 
> ...



Hi DutchDaemon, I have tried this as well, but it is still resulting of system hangs,..



			
				warudemaru said:
			
		

> Suspend/Resume should work with
> 
> ```
> kern.smp.disabled=1
> ...



Hi Warudemaru, I also tried this as well, with the code has been told by DutchDaemon and Loop, but resulting if the laptop is closed, the system will reboot,..

So, just to let the system to keep running while the laptop is closed I have put the following code to /etc/sysctl

```
hw.acpi.suspend_state=NONE
```
and with that code, the question number 2 is solved,.. but basically that is what I was looking for,..

Thank you everyone for the great responses,..


----------

