Debian – looking for the settings that causes Debian to suspend when laptop lid is closed

debiansuspend

When I close my laptop lid while am on a console and not in a graphical environment, my Debian-laptop goes to a state of suspend (hard disk and fan turn off, laptop's half-moon LED turns on). I like my system behaving in such a way but I have never set it up this way and would like to know where and what setting is causing this?

Some people in certain forums hint to HandleLidSwitch in /etc/systemd/logind.conf but these two lines in the file containing it are commented out on my system.

Best Answer

For systemd users there is a setting in /etc/systemd/logind.conf:

HandleLidSwitch

If you put HandleLidSwitch=ignore it will disable the switch.

You will need to restart systemd-logind daemon.

$ sudo service systemd-logind restart


For more low level, kernel solution: (found here: How to ignore lid switch action? and here: how to completely disable laptop lid detection? )

find node for the lid:

# grep LID /proc/acpi/wakeup
LID       S3    *enabled   platform:PNP0C0D:00

The node is PNP0C0D:00 here. Write it to /sys/bus/acpi/drivers/button/unbind

like that:

# grep LID /proc/acpi/wakeup | sed -e 's/^.*platform://' > /sys/bus/acpi/drivers/button/unbind

For permanent effect you can put it in /etc/rc.local or /etc/rc5.d wherever your startup scrips are. 5 in rc5.d is your desired runlevel you use; can be found out with $ who -r)

Important note: Test this one first as for me it disabled suspending when I close lid - that is fine, but it still turns off screen and to get it back I needed to press Ctrl+Alt+F1 to get to terminal and run pm-suspend and then unsuspend it with home button. But I hope it will work for you.

Related Question