5

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.

0

1 Answer 1

2

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.

5
  • 1
    thanks for your quick reply. As I wrote in my original post, it is not systemd providing this feature on my system. After all, I am using SysV init instead of systemd. Commented Jan 24, 2020 at 16:31
  • I didn't read that properly, sorry, but I found something for you. Hopefully will work. Check edited answer. Commented Jan 25, 2020 at 4:58
  • Thanks, tansy, that stops my laptop from suspending when the lid is closed. But I would also like to know what is the command that my Debian executes for suspending when lid is closed. I can find it in none of the files that we needed to touch for deactivating it... Commented Jan 27, 2020 at 15:56
  • Unbinding it in /proc is kernel thing, so to answer this you would need to dig in the kernel sources. I don't think there is a command behind that. That's why it's so problematic. But anyway, I'm glad it worked for you. Commented Jan 27, 2020 at 19:04
  • Just to confirm that thesis - there is a page where one can report problems with kernel during suspending/hibernating: Debugging kernel hibernate. Commented Jan 28, 2020 at 1:07

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.