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

Ok, I know there already are several questions related to this. I tried many solutions to no avail. I'm going to detail here what I did and how are my config files in the hope that a good soul will point out what I missed.

Some initial information:

  • I installed Ubuntu 14 from a 14.01 .iso and it became a 14.04 because, I guess, I checked an option to update automatically during the install.
  • I have an external monitor attached. This seems to be relevant in some cases.
  • As explaned here, there is no option to make the PC hibernate in the power settings of Ubuntu 14. Only suspend and do nothing.
  • pm-hibernate works fine.
  • My swap is slightly larger than my RAM

1. I had a Mint (14 if I'm not mistaken) where closing the lid would not hibernate until I added some scripting. In Ubuntu 14 there is no /etc/acpi/ that I can edit as I did in Mint. I tried to create one with the following contents:

echo 'ok' > ok
grep -q closed /proc/acpi/button/lid/*/state
if [ $? = 0 ]
    su - gabriel -c 'dconf read /org/gnome/settings-daemon/plugins/power/lid-close-ac-action' | grep hibernate
    if [ $? = 0 ]

The file ok is not created when I close the lid, this means the script is never called.

I tried to move into events/.

As suggested here, I tried to rename it to and to move it to /etc/acpi/local/, and other several combinations of directory and names (with/without .post, in /etc/acpi/, local/, events/...)

2. I did as told here and installed gnome-tweak-tool, so I could set the action on closed lid to hibernate. After I did, the dropdowns in the control panel / power were blank (not suspend nor 'do nothing'), but now they show 'do nothing' again, I don't know what I did to change that. And running

su - gabriel -c 'dconf read /org/gnome/settings-daemon/plugins/power/lid-close-ac-action'

still returns 'nothing', which compromises my (probably useless anyway) script.

3. I did as told here: edited /etc/systemd/logind.conf and set HandleLidSwitch to 'hibernate':

cat /etc/systemd/logind.conf | grep -i lid

I also tried with


4. As explained here and here, I edited /var/lib/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla:

root@gabriel-linux:/var/lib/polkit-1/localauthority/50-local.d# cat com.ubuntu.enable-hibernate.pkla 
[Re-enable hibernate by default in upower]

[Re-enable hibernate by default in logind]
share|improve this question
do you have a swap partition at least as large as your ram? – sbergeron Aug 29 '14 at 17:57
@sbergeron, yes – Gabriel Aug 29 '14 at 19:00
is it mounted when you try to hibernate? – sbergeron Aug 29 '14 at 19:01
Not sure how to check that... The Disks utility says it's "active". Is that ok ? – Gabriel Aug 29 '14 at 19:07
go into gparted and right click then if it says swapkon click it to turn it on and try again – sbergeron Aug 29 '14 at 19:09
up vote 2 down vote accepted

For my script ( to be called in /etc/acpi/, I had to create the correct file in /etc/acpi/events/.

The file has to be called lm_lid and the content is as follows:


Reboot your system to let this take effect.

Note: I moved back to Linux Mint (now 17) before I figured this all out, and this, with the correct file, now works. I'd like to hear from Ubuntu users though.

share|improve this answer
related: Catch lid close and open events – rubo77 Oct 8 '14 at 7:26

I had a similar problem in Linux Mint 17.3. It went away when I installed the nvidia video driver in the place of the default open source one. (Administration->Driver Manager->Select nvidia recommended driver)

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.