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.

I am running 12.10. Usually when I am in a hurry I press the shutdown button on the bar and close the lid of my laptop just after that. Often, I observe that instead of shutting down, the system suspends (because I closed the lid right after) and the shut down process resumes after I reopen the lid which wakes it up.

Is there any workaround such that once the shutdown button has been pressed, Ubuntu does not allow "suspension on lid close" and it carries out the shutdown (and not the sleep) even if the lid is pulled down right after the shutdown button is pressed?

Also, I don't want to switch off the "sleep on lid close" feature either.

share|improve this question
    
This might be an issue unique to lightdm. Perhaps gdm will not have this problem.. –  hnasarat Feb 2 '13 at 14:20
    
May be any logout script delay the process. –  totti Feb 2 '13 at 15:18
    
I have observed the same behavior on Windows 7 as well. –  Pavel A Feb 8 '13 at 8:04
    
I think you have a process that is slowing down shutdown. Have you tried looking in the shutdown logs or whatever they are called ? –  Suhaib Feb 8 '13 at 21:34
    
manage your time better so you are not in such a hurry? –  TheX Apr 30 '13 at 2:47
show 5 more comments

3 Answers 3

This is a bug, subscribe to it and wait till it's fixed: https://bugs.launchpad.net/ubuntu/+source/gnome-power-manager/+bug/471457

share|improve this answer
add comment

You can try add this line sleep 5 bellow #!/bin/bash in file /etc/acpi/lid.sh.

Second possibility is edit /etc/acpi/powerbtn.sh as following and old content leave below as backup (this is from this question askubuntu.com)

#!/bin/sh
# /etc/acpi/powerbtn.sh
# Initiates a shutdown when the power putton has been
# pressed.

/sbin/shutdown -h now "Power button pressed"
exit 0

# leave the old code below (in case you want to revert!)
share|improve this answer
add comment

The best option is to change the suspend option when lid is closed. Change the lid close option to nothing. The shutdown process was initiated first but some process delays it and mean while when you close the lid it gets suspended.

share|improve this answer
add comment

protected by Community Apr 16 at 18:35

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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