Ubuntu – Ubuntu 15.04 suspends ~30 seconds after resume

hibernateresumesuspend

I just upgraded yesterday to 15.04 from 14.10 using sudo do-release-upgrade -d. My computer suspends and resumes with no trouble, however every time I resume, after about 30 seconds the computer goes back into suspend. If I resume, the same pattern continues.

Suspending from virtual console (ctrl+alt+F2) using sudo pm-suspend does not cause the same problem, and I can safely switch to ctrl+alt+F2, suspend, then switch back to ctrl+alt+F7 without running into the auto-suspend problem.

However, if I suspend from the graphical screen (ctrl+alt+F7), and then switch to the virtual console, it will still automatically suspend. This happens even if within the virtual console I force a suspend before the computer automatically does it and resume, and stay within the virtual console. Every time the computer will automatically suspend again within about 30 seconds.

This makes my computer effectively unusable until I restart, after which it works fine (until I suspend from the graphical interface again, at which point I must restart).

Any ideas on what might be wrong? I have a 2013 Razer Blade 14, which has always worked with previous version of Ubuntu. Thanks!

Best Answer

I'm seeing the same problem on my Sony Vaio. Once I manage to get logged into the Lubuntu desktop, it stops suspending every 30 seconds. I think this is because xfce4-power-manager is taking over.

However, if I switch to a console, it immediately suspends, and resumes its "suspend after 30 seconds" behavior. I also see the "suspends after 30 seconds" behavior on the default Unity desktop.

I've found I can put an end to this behavior by making /sys/power/state non-writable (chmod 444), and I can get this to persist between boots by adding the chmod command to /etc/rc.local, before the "cgroup" commands.

Now that I have made /sys/power/sleep non-writable, I'm seeing evidence in syslog of what's going on. Every 30 seconds, I see this:

Apr 28 11:08:48 socrates systemd-sleep[8831]: Failed to open /sys/power/state: Permission denied

I'm also seeing other writes to syslog every 30 seconds related to whatever is trying to put the system to sleep, starting with:

Apr 28 11:31:10 socrates NetworkManager[825]: <info> sleep requested (sleeping: no enabled: yes)

After the "Permission denied" error, there are a bunch of messages from NetworkManager waking back up, named reloading its configuration, etc.

These writes to syslog only occur when I'm on the virual console, and stop when I switch back to the Lubuntu desktop.

Update: Issues mostly resolved by switching back to Upstart, as detailed here: https://wiki.ubuntu.com/SystemdForUpstartUsers

Still seeing this every 30 seconds in syslog:

Apr 28 12:45:51 socrates dbus[775]: [system] Activating service name='org.freedesktop.systemd1' (using servicehelper)

This is followed by anacron running. This only happens when using the virtual console.

Update: If I make /sys/power/sleep writable, problem resumes, even after switching from systemd to upstart.

Update: Bug reported. https://bugs.launchpad.net/ubuntu/+source/dbus/+bug/1450013

Update: Problem completely solved by setting "HandleLidSwitch=ignore" in /etc/systemd/logind.conf.

Related Question