4

Old OS/kernels: Ubuntu 15.10 with 4.4 kernels manually installed. New OS/kernels: Ubuntu 16.04 (no custom kernels, so 4.4 in place).

Since upgrading to 16.04 it doesn't suspend correctly. when I open the lid again later it reboots. Instead of showing the login screen it goes through BIOS and GRUB etc. Power settings shows how much battery I have left, shows Power saving options and under 'Suspend & Power Off' it has 'Automatic Suspend: Off'. It doesn't have settings for 'When the lid is closed'.

/etc/systemd/logind.conf looks like this:

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#UserTasksMax=12288

So HandleLidSwitch=suspend is turned on.

EDIT:

Suspending 'works' so much that on lid close it suspends. However, it seems to tell the BIOS the wrong thing or something, because it doesn't actually suspend. I ran sudo pm-suspend which should suspend it, but when I then hit the power-switch again to get it out of suspend it started going through the bootcycle again.

3 Answers3

1

Tested on Ubuntu 21.04, the GUI option is available on gnome-tweak-tools:

sudo apt install gnome-tweak-tools
gnome-tweak-tools

under:

  • General
  • Suspend when laptop lid is closed

Asking at https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1384 why not just add it to the main settings.

enter image description here

  • Thanks, this solved my bug in Mint 20 where connecting an external monitor would make the "do nothing when lid is closed" option disappear from power settings. – SurpriseDog Oct 27 '21 at 15:52
0

To get Ubuntu working (including wifi) on my xps 9350, I had previously installed the 4.4.2 kernel on 15.10. I had disabled kernel-updates so to keep this working kernel in place. It didn't work with 16.04 however, so I let Linux update its kernels again and everything is working smoothly as before.

0

I have no idea why great Ubuntu team did not implemented "power off when lid is closed" option. I have laptop with cooler powered trough the USB and my USB port is always ON when laptop is in suspend state, so suspend is not good option for me. Anyway finally I found solution and is working for me (Ubuntu 16.04 with two internal HDD's and external monitor). Maybe it can help a bit others Ubuntu users.

Do as follow:

sudo nano /etc/systemd/logind.conf

and remove # from lines: HandleLidSwitch=poweroff HandleLidSwitchDocked=poweroff

Next: Second internal HD must be mounted:

  1. Install disks utility software from software center
  2. Choose iternal disk from GUI (left side)
  3. Select gear icon below "Volumes" and "Edit Mount Options"
  4. Switch "Automatic Mount Options" to OFF
  5. Check "Mount at startup" and "Show in user interface"
  6. Put the name in "Display Name" field (important!!!)
  7. Hit OK and restart the computer
Marek
  • 9