# How to stop laptop from sleeping when lid is closed



## Aaron_VanAlstine (Feb 18, 2013)

I have an old laptop that I'd like use as a web server; however, it likes to sleep/hibernate when the lid is closed. Can I edit /etc/sysctl.conf so the laptop will stay awake 24/7?


----------



## BlueCoder (Feb 18, 2013)

I believe you need to change devd.conf so that it doesn't respond to whatever ACPI message is generated.

You can override the defaults in devd.conf by creating a file of your own in /etc/devd/ or /usr/local/etc/devd/.


----------



## Aaron_VanAlstine (Feb 18, 2013)

The only line I found in devd.conf is below:


```
# Lid:          Lid state (0 is closed, 1 is open)
```

However, I don't see anywhere I can edit to modify the lid state. Perhaps that is referring to something in the kernel?


----------



## BlueCoder (Feb 18, 2013)

Might still be able to do it with devd which would be the proper way. But on the acpi() man page it says you can put something like this in loader.conf:


```
debug.acpi.disabled="lid"
```


----------



## paulfrottawa (Feb 20, 2013)

I user Gnome 

```
gconftool-2 -s --type string /apps/gnome-power-manager/buttons/lid_ac nothing
```


----------



## Aaron_VanAlstine (Feb 21, 2013)

Thanks. However, I didn't install X Windows since it's a server.


----------



## paulfrottawa (Feb 23, 2013)

Freebsd without X normally doesn't turn off when closing the lid. Maybe its your bios. I'll check this myself by turning off X and closing the lid for an hour.

Maybe 9.1 isn't the same.  I'll check back here in an hour and post the result.
____________________________________________________________________
OK done 
I didn't have a problem using the computer after closing the lid for an hour and then opening the lid.

PS: While your booting if you notice your waiting to resolve a network hit "clrl c" key-binding to continue. This OS doesn't like reading the /etc/rc.conf for a long period. This happens if your not resolving right and messes things up.


----------



## srobert (Feb 23, 2013)

Read http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/acpi-debug.html
Check the value from sysctl hw.acpi.lid_switch_state
Try setting it to "NONE" in /etc/sysctl.conf.


----------



## Aaron_VanAlstine (Feb 24, 2013)

Well, looks like it already is.


```
[root@ /etc]# sysctl hw.acpi.lid_switch_state
hw.acpi.lid_switch_state: NONE
```


----------



## srobert (Feb 24, 2013)

Aaron_VanAlstine said:
			
		

> Well, looks like it already is.
> 
> 
> ```
> ...



You mentioned that it's an older laptop. Is there a chance that it's using apm instead of acpi?

Another pertinent section in the handbook if that's the case:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/acpi-overview.html


----------



## kpedersen (Feb 24, 2013)

Perhaps have a look around the bios of your laptop.

None of my laptops sleep when I close the lid by default. I would need to set that up, which leads me to believe that either it is in some sort of different driver you are using or it is controlled by the hardware / bios.

I did have a Windows 95 laptop a few years back where the suspend was completely handled by the hardware rather than the OS. I.e I could get it to suspend half-way through booting Windows lol.


----------

