Okay, if you are typing on the laptop but /proc/acpi/button/lid/LID/state is closed, then it's a kernel bug, systemd can't do much here...
** Also affects: linux (Ubuntu) Importance: Undecided Status: New -- You received this bug notification because you are a member of Kernel Packages, which is subscribed to linux in Ubuntu. https://bugs.launchpad.net/bugs/1680421 Title: Computer suspends/sleeps before login Status in systemd: Unknown Status in linux package in Ubuntu: New Status in systemd package in Ubuntu: New Bug description: I am not able to login into the system because it sleeps in the boot process. To fix this, I need to edit (in recovery mode) the /etc/systemd/logind.conf to replace the following options: HandleLidSwitch=ignore HandleLidSwitchDocked=ignore This behaviour started in Ubuntu 14.10. Some other users have this issue too: http://askubuntu.com/questions/829998/ubuntu-16-04-usually-suspends-before-login-and-while-logout ProblemType: Bug DistroRelease: Ubuntu 17.04 Package: systemd 232-19 ProcVersionSignature: Ubuntu 4.10.0-15.17-generic 4.10.5 Uname: Linux 4.10.0-15-generic i686 ApportVersion: 2.20.4-0ubuntu3 Architecture: i386 CurrentDesktop: GNOME Date: Thu Apr 6 08:25:20 2017 InstallationDate: Installed on 2017-04-06 (0 days ago) InstallationMedia: Ubuntu-GNOME 17.04 "Zesty Zapus" - Beta i386 (20170405) MachineType: Positivo Positivo Mobile PccardctlIdent: Socket 0: no product info available PccardctlStatus: Socket 0: no card ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.10.0-15-generic root=UUID=f7649356-2952-4c27-9279-c3ab658730ad ro locale=pt_BR quiet splash vt.handoff=7 SourcePackage: systemd UpgradeStatus: No upgrade log present (probably fresh install) dmi.bios.date: 06/08/2006 dmi.bios.vendor: Phoenix dmi.bios.version: 4.06CJ15 dmi.board.name: M5X0V dmi.board.vendor: CLEVO Co. dmi.board.version: None dmi.chassis.asset.tag: No Asset Tag dmi.chassis.type: 1 dmi.chassis.vendor: No Enclosure dmi.chassis.version: N/A dmi.modalias: dmi:bvnPhoenix:bvr4.06CJ15:bd06/08/2006:svnPositivo:pnPositivoMobile:pvrVT6198:rvnCLEVOCo.:rnM5X0V:rvrNone:cvnNoEnclosure:ct1:cvrN/A: dmi.product.name: Positivo Mobile dmi.product.version: VT6198 dmi.sys.vendor: Positivo mtime.conffile..etc.systemd.logind.conf: 2017-04-06T08:15:16.198796 To manage notifications about this bug go to: https://bugs.launchpad.net/systemd/+bug/1680421/+subscriptions -- Mailing list: https://launchpad.net/~kernel-packages Post to : kernel-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~kernel-packages More help : https://help.launchpad.net/ListHelp