How to stop laptop from going to sleep when lid closed (18.04 LTS Mate)

Bo Berglund bo.berglund at gmail.com
Mon Apr 20 06:25:06 UTC 2020


On Mon, 20 Apr 2020 10:43:58 +1000, Karl Auer <kauer at biplane.com.au>
wrote:

>On Sun, 2020-04-19 at 16:02 +0100, Colin Law wrote:
>> I haven't had much luck with hibernation when I have tried it.
>
>On modern hardware with SSD drives a full reboot is fast enough to make
>hibernation redundant. It takes longer to shut my laptop down than it
>does to reboot (though I do then have to spend some time getting my
>usual windows open and logged in). I just don't bother with
>hibernation. I sleep the laptop if it's only be a few hours, and shut
>down otherwise. Since it is very, very rare than I don't use my laptop
>in any eight-hour period, I basically never shut it down...
>

I need the laptop to continue running with the lid closed because it
will normally be headless and accessed via SSH (PuTTY from Windows) or
VNC. So the key actions need to be set as indicated by Colin.
And this makes suspending it more difficult than just closing the
lid..

But I have a few problems with suspend/hibernate anyway:

1) If I have a lot of windows open in different states and need to
quickly relocate or similar but keep my workspace, then a working
hibernate should be nice to have. With suspend you still rely on the
battery (my battery is not good).

I have hibernated for many years with Windows even though I have used
SSD drives for about 10 years now.
It is just such a hassle saving all the web browser states as
bookmarks before leaving. Hibernate is a perfect help here.

2) But this is the killer with Ubuntu suspend:
If the laptop is suspended then it is IMPOSSIBLE to get it back into
operating state. It just will not start up again.
The only way I have found to get it working again is to long press the
power button so BIOS switches it off completely, and then start it
normally. Of course this totally voids the suspend feature.


NOTE on my progress:
---------------------
When I edited the file and entered the "ignore" items I must have
accidentally touched an accent key when typing one of them so the
ignore became ígnore instead. I could not see any difference but the
laptop has behaved kind of strange, mainly working like I want but not
quite...

Since I document all config actions I do on new systems I was writing
up the procedure today and copied the content of the file via PuTTY to
my working document in Windows. And when proof reading it I saw that
one of the ignore entries looked "funny".
So this item was the setting for HandleSuspendKey, which then must
have been screwing the system up.

Pretty dangerous when the difference between i and í is so slight!


-- 
Bo Berglund
Developer in Sweden





More information about the ubuntu-users mailing list