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

Bo Berglund bo.berglund at gmail.com
Sun Apr 19 11:49:57 UTC 2020


On Sun, 19 Apr 2020 11:49:38 +0100, Colin Law <clanlaw at gmail.com>
wrote:

>On Sun, 19 Apr 2020 at 07:33, Bo Berglund <bo.berglund at gmail.com> wrote:
>> ...
>> The Ubuntu install on the laptop seems not to be able to run in a
>> headless mode 24/7 unless the lid is open. It simply won't stop going
>> into suspend after some time (don't know how long before it suspends,
>> but it is not doing it immediately).
>
>I can't guarantee this will help but you could try editing
>/etc/systemd/logind.conf and see what HandleLidSwitch is set to.  It
>will probably be commented out in which case uncomment it and make
>sure it is set to ignore.
>
>HandleLidSwitch=ignore
>
>Then restart the daemon
>sudo systemctl restart systemd-logind
>which I think will log you off.  It might be easier just to reboot.
>

Thanks for the suggestion!
Currently the file contains this:

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

So most items are commented out except thes:
HandlePowerKey=suspend
HandleSuspendKey=suspend
HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend

Should I modify all of these to ignore?

Since suspend does not work, i.e. it is a 1-way street from where only
a hard power cycle can bring the system back up, maybe *all* of the
suspends should be set to ignore?

And I don't know which key is actually the "SuspenfKey" anyway....


-- 
Bo Berglund
Developer in Sweden





More information about the ubuntu-users mailing list