The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

Views: 1,330โ€…    Votes:  4โ€…    โœ… Solution
Tags: 16.04   login   64-bit   suspend   logout  
Link: ๐Ÿ” See Original Answer on Ask Ubuntu ๐Ÿ”—

URL: https://askubuntu.com/q/830095
Title: Ubuntu 16.04 usually suspends before login and while logout
ID: /2016/09/27/Ubuntu-16.04-usually-suspends-before-login-and-while-logout
Created: September 27, 2016    Edited:  April 13, 2017
Upload: November 24, 2022    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false


Although you didnโ€™t say your laptop was docked the symptoms you describe can be found in bug reports posted by other users experiencing errors when logging out whilst docked.

There is a bug report on this for Lenovo ThinkPad T400 suspends upon log-out from GNOME when docked and lid closed when using Fedora 25 https://bugzilla.redhat.com/show_bug.cgi?id=1365719.

There is a problem reported under Ubuntu 15.10 where the system logs out when resuming from suspend: Logged out on resume from sleep ubuntu 15.10. The interesting point is it happens most of the time but not all the time, such as yourself.

This is the closet Iโ€™ve found to your problem: Ubuntu 16.04: Logout cause the PC to suspend/sleep which references another user with the same problem: Ubuntu 16.04 sleeps / suspend before login screen.

It would appear your laptop is docked and the lid is closed when you log out which causes the system to suspend. To prevent this enter the Terminal by pressing Ctrl+Alt+T and then typing:

gksu gedit /etc/systemd/logind.conf

Search for these lines and make them look like this (possibly by removing # in front or replacing suspend with ignore):

HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore

Save the file and quit gedit. Reboot your laptop.

Edit 1

Via comments the OP confirms the recommended changes solves the problem. A comment asks โ€œWhy isnโ€™t this available in GUI?โ€ The logind.conf file is part of systemd which Ubuntu has only recently embraced. Conversion from the old programs to the new programs with full GUI support takes time.

There are GUIโ€™s already for Suspending, Hibernating or โ€œDoing nothingโ€ when lid is closed but additional options need to be added for when docked or when plugged into an HDMI monitor.

Suspend was already complicated with Kernel methods (Freeze, Standby and Memory/STR (Save To Ram), ACPI Events, acpid, PM, APM and gnome-settings (sorry for typoโ€™s Iโ€™m going off memory) and systemd adds another level of complexity for all the Linux programmers out there tips hat

โ‡ง When I close the lid of my laptop, the Wifi should not disconnect automatically Password set but login without password?  โ‡ฉ