Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Sometimes (but not always), I use my laptop exactly like a desktop computer: I power it on with the lid closed and an external monitor and USB keyboard and mouse connected. When I later want to shut it down, the lid is still closed. It used to power down just fine with previous versions of Ubuntu (12.04 and 12.10 for sure, 13.04 probably as well).

Ever since I installed Ubuntu 13.10, instead of powering down, my laptop now goes to sleep immediately after logging me off. The actual shutdown sequence only happens if I open the lid again, otherwise my laptop stays suspended.

So I have been caught a few times with my laptop still on when I expected it to be off. Not a good idea to shove a running computer inside a closed bag that I carry around!

Searching around, I find a lot of people with the opposite problem (computer shutting down when they really want to suspend). I also read many people advising to make changes to some "systemd" setting to ignore the suspend altogether, which I am wary about: why would I want to disable suspend completely for a single type of situation while I still want my laptop to suspend when I use it on battery power? And even more since it used to work just fine with previous versions of Ubuntu.

Do you guys have any idea what the problem might be, or how I could troubleshoot this deeper?

--- EDIT: I am left with an additional question: is this problem specific to my computer, have I done something wrong to cause it? As soon as I have time, I will try to work on this. Like, does this happen from the live CD? Does it happen on a different laptop computer? Does it happen with a completely clean install on my current computer? I will let you know what I find out.

share|improve this question
    
Very odd, for the life of me, I cannot reproduce the problem anymore. I have turned it around in all directions: with and without power cable, with monitor connected before and after turning on, tried using it on battery, then connecting it to monitor, etc. No scenario I could come up with that seemed to have caused the problem in the past have triggered the problem again. So... maybe this has been fixed in an update or something? –  Alex Dec 21 '13 at 10:07
add comment

1 Answer 1

You need to configure logind.conf - this would not disable the suspend, it would just to tell it to ignore the lid switch, or just lock screen.

This would also override any of your user's power settings, but it will work in the login screeen or when it is shutting down, when it is outside the user session and unaffected by the user's power settings.

You can configure it via:

sudo nano /etc/systemd/logind.conf

and change the HandleLidSwitch= line to:

HandleLidSwitch=ignore

Here is a qoute from a manual page - note it can take other values like lock, poweroff etc.

HandlePowerKey=, HandleSuspendKey=, HandleHibernateKey=, HandleLidSwitch=

Controls whether logind shall handle the system power and sleep keys and the lid switch to trigger actions such as system power-off or suspend. Can be one of "ignore", "poweroff", "reboot", "halt", "kexec", "suspend", "hibernate", "hybrid-sleep" and "lock". If "ignore", logind will never handle these keys. If "lock", all running sessions will be screen-locked; otherwise, the specified action will be taken in the respective event. Only input devices with the "power-switch" udev tag will be watched for key/lid switch events. HandlePowerKey= defaults to "poweroff". HandleSuspendKey= and HandleLidSwitch= defaults to "suspend". HandleHibernateKey= defaults to "hibernate".

The manual page is here

share|improve this answer
    
OK, this seems very interesting and I will try it out later when I am near my external monitor. From reading your message, I gather that it will completely ignore my laptop lid. However, that is not what I want: I sometimes want to be able to suspend when I close the lid, like when I am running on battery power. I just don't want it to put my computer to sleep when I try to power it off with the lid closed: that's the only behavior I want to change (which used to work correctly), the rest can/should stay. –  Alex Dec 8 '13 at 13:42
    
Before trying your suggestion, I wanted to reproduce the problem first, to make sure I could verify that it went away. I have never been able reproduce it! Maybe this odd behavior has been fixed in an update? –  Alex Dec 21 '13 at 10:10
    
Might of been - I had to do a similar fix a while ago, but then I reset the changes in a update, and it worked properly anyway... :-s –  Wilf Dec 21 '13 at 12:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.