You are not logged in.

#1 2016-04-02 14:53:44

youarefunny
Member
From: Toronto, Canada
Registered: 2010-11-13
Posts: 42

Prevent sleep while shutting down.

Hello everyone.

I was wondering if anyone had a solution to preventing a laptop from going to sleep while shutting down. Often I would like to click "Shutdown" close the lid and stuff the laptop in my bag. However currently that causes the laptop to go to sleep part-way though the shutdown process which is something I imagine most people don't want.

I was wondering if anyone has a solution to this? It seems to me like the only time I want suspend on lid close is in multi-user.target. Is blacklisting systemd-logind from other targets somehow a possible way to do this?

Bonus points if anyone has a way to get PackageKit offline updating to work. So I could click "Shutdown", and have it reboot, install updates and power off.

Offline

#2 2016-04-02 16:37:57

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,784

Re: Prevent sleep while shutting down.

What desktop environment are you using?  What is controlling the sleep on lid close?  There are several possibilities -- Several desktop environments will do it, as will systemd and acpi.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2016-04-02 16:46:20

youarefunny
Member
From: Toronto, Canada
Registered: 2010-11-13
Posts: 42

Re: Prevent sleep while shutting down.

I am using GNOME but I'm pretty sure that my suspend is being managed by systemd-logind.

Offline

#4 2016-04-02 17:01:07

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,784

Re: Prevent sleep while shutting down.

Take a look at your /etc/systemd/logind.conf
Try changing that file by uncommenting the HandleLidSwitch line and changing the action to ignore

Last edited by ewaller (2016-04-02 17:01:25)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#5 2016-04-02 17:22:22

youarefunny
Member
From: Toronto, Canada
Registered: 2010-11-13
Posts: 42

Re: Prevent sleep while shutting down.

I don't want to disable HandleLidSwitch in this case. I just want it to not apply when the system is shutting down (and preferably doing offline package updates as well).

Offline

#6 2016-04-02 17:30:25

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,784

Re: Prevent sleep while shutting down.

I cannot think of  trivial way of handling that.  My inclination would be to disable systemd using logind.conf, and instead use ACPI.  The ACPI script could be written determine the state of the machine and suspend (or not) as appropriate.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB