Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use Ubuntu 12.04 in my laptop. I'm trying to configure to hibernate when lid is closed. However, not is working. I did the following steps to solve the problem:

  • I enable in /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
  • System Settings - Power
  • I used the dconf Editor.

When I lid closed instead hibernate is suspend. I try run sudo pm-hibernate and works fine.

Any suggestion ?

share|improve this question
Did you modify your power settings so that it will use hibernate instead of suspend on lid closing? – Thomas Ward May 7 '13 at 6:11
What ? I modify my power settings to use hibernate instead of suspend. However, when I lid close is suspend. – user2692786 May 7 '13 at 6:18
And you set it for BOTH of the power settings, for the battery AND AC connected states, right? – Thomas Ward May 7 '13 at 6:20
Yes, both are configured like hibernate. – user2692786 May 7 '13 at 6:22
up vote 2 down vote accepted

Note: try pm-hibernate in a shell before trying this. If it works, go ahead.

I fixed it by...

  • Using cinnamon-settings / Power to set the event to Hibernate. This sets the dconf values /org/gnome/settings-daemon/plugins/power/lid-close-ac-action and /org/gnome/settings-daemon/plugins/power/lid-close-battery-action to what you want

  • Editing /etc/acpi/events/lm_lid (gksudo gedit /etc/acpi/events/lm_lid) and filling it with

  • Editing /etc/acpi/ (gksudo gedit /etc/acpi/ If it's empty, fill it with
grep -q closed /proc/acpi/button/lid/*/state
if [ $? = 0 ]
    su - gabriel -c 'gsettings get org.cinnamon.settings-daemon.plugins.power lid-close-ac-action' | grep hibernate
    if [ $? = 0 ]

Otherwise, look for the right place to put the code above

Replace gabriel by your username. You have to do the su thing before calling gsettings get because this script is ran as root, and running gsettings get as root would return the preferences for root instead of your user.

You could just call pm-hibernate but then changing options in cinnamon-settings would not work anymore. I did not care to check whether my notebook is on AC or battery, because it's irrelevant: I want the same behaviour always anyway. Maybe someone wants to add an if there?

share|improve this answer

Here is how you fix that.

In your file:


Make sure you have two settings in there

[Enable hibernate by default in upower]

[Enable hibernate by default in logind]

Here is why. In this file:


it sets the two options to "no"

The file you created should be executed after the one in /var/lib so it should take priority over it (Tested it and it does). You can read the information for that here under the section "Evaluation Order". When your "upower" option is set to "yes" you can select hibernate from the power settings in Ubuntu. However, you are still unable to hibernate because the 10-vendor.d file was setting the login1.hibernate to "no" and that must also be a "yes"

share|improve this answer

Your Answer


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.