You are not logged in.

#1 2014-06-05 05:01:25

mrueegg
Member
Registered: 2013-08-24
Posts: 13

Systemd: Suspend and Hibernate not working

Hi,

When I try to hibernate my Notebook using systemd with 'systemctl hibernate', it sometimes (from time to time it even works) fails with the error message "a dependency job for hibernate.target failed". In the journal I see the following:

The system clock has been changed to REALTIME microseconds after January 1st, 1970.
Jun 04 23:52:57 localhost systemd[1]: systemd-hibernate.service: main process exited, code=exited, status=1/FAILURE
Jun 04 23:52:57 localhost systemd[1]: Failed to start Hibernate.
-- Subject: Unit systemd-hibernate.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li … temd-devel
--
-- Unit systemd-hibernate.service has failed.
--
-- The result is failed.
Jun 04 23:52:57 localhost systemd[1]: Dependency failed for Hibernate.
-- Subject: Unit hibernate.target has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li … temd-devel
--
-- Unit hibernate.target has failed.
--
-- The result is dependency.
Jun 04 23:52:57 localhost systemd[1]: Service sleep.target is not needed anymore. Stopping.
Jun 04 23:52:57 localhost systemd[1]: Unit systemd-hibernate.service entered failed state.
Jun 04 23:52:57 localhost systemd[1]: Stopping Sleep.
-- Subject: Unit sleep.target has begun shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li … temd-devel
--
-- Unit sleep.target has begun shutting down.
Jun 04 23:52:57 localhost systemd[1]: Stopped target Sleep.
-- Subject: Unit sleep.target has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li … temd-devel
--
-- Unit sleep.target has finished shutting down.
:x

Any ideas? Furthermore, during hibernate (when it works) my screen first gets black, the system comes back and only then it really hibernates.

Others suggest switching to linux-lts. Does that really make sense? Isn't this a systemd issue?

suspend sometimes fails to work either (screen gets blank, but system weaks up after a few seconds again):

Jun 05 06:59:14 localhost systemd[1]: Stopping Sleep.
-- Subject: Unit sleep.target has begun shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li … temd-devel
--
-- Unit sleep.target has begun shutting down.
Jun 05 06:59:14 localhost systemd[1]: Stopped target Sleep.
-- Subject: Unit sleep.target has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li … temd-devel
--
-- Unit sleep.target has finished shutting down.
Jun 05 06:59:14 localhost systemd[1]: Reached target Suspend.
-- Subject: Unit suspend.target has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li … temd-devel
--
-- Unit suspend.target has finished starting up.
--
-- The start-up result is done.


Thanks,
Michael

Offline

#2 2014-06-10 01:42:06

fungle
Member
Registered: 2014-05-01
Posts: 81

Re: Systemd: Suspend and Hibernate not working

Try running this command

 sudo /usr/lib/systemd/systemd-sleep hibernate 

If that works, then did you mess with any of the systemd unit files? Check the relevant unit files like /usr/lib/systemd/hibernate.target or /usr/lib/systemd/systemd-hibernate.service and check the directory /usr/lib/systemd/system-sleep/ for any scripts that maybe causing hibernation to fail. Also check /etc/systemd/system/.

Offline

#3 2014-06-12 05:08:12

mrueegg
Member
Registered: 2013-08-24
Posts: 13

Re: Systemd: Suspend and Hibernate not working

The command you have given works. And I don't have any of the mentioned files on my filesystem. Lately, I have never experienced the hibernate problem again. So this might be okay.

What still exists is the case that during hibernate my screen first gets black, the system comes back and only then it really hibernates. Any ideas?

Furthermore, suspend only works non-deterministically. Sometimes it's okay, but most of the times the system comes back after a few seconds. Is it worthwhile to switch to the linux-lts kernel? Another solution might be to to disable all the wake-up devces in /proc/acpi/wakeup and then to always push the power button after opening the lid. This is more effort, but better than a non-functional suspend...

Offline

#4 2014-06-13 07:43:14

fungle
Member
Registered: 2014-05-01
Posts: 81

Re: Systemd: Suspend and Hibernate not working

When you hibernate, you flush all working memory into disk and some other preparations, so that may take awhile. As long as it goes into hibernate fine and comes back on ok, then I wouldn't worry about it, unless you're saying the problem is you tell it to hibernate, it comes back on, and you have to tell it to hibernate again before it hibernates. You can try the lts kernel, but I hear some users have suspend issues with it that get fixed when they switch to the mainline kernel. I think I only have the powerbutton (PBTN) and lid (LID) enabled on my laptop so you can try the /proc/acpi/wakeup thing too.

If you are missing those unit files, I would suggest reinstalling systemd, you technically don't wanna call systemd-sleep manually, as it bypasses the unit files and you won't be able to hook services on sleep and wakeup.

Offline

#5 2014-06-13 12:47:18

mrueegg
Member
Registered: 2013-08-24
Posts: 13

Re: Systemd: Suspend and Hibernate not working

Thanks, but I do not call systemd-sleep manually, I just do the ordinary "systemctl hibernate".

Unfortunately, the error "A dependency job for hibernate.target failed. See 'journalctl -xn' for details" just happened again. Alas, I'm not able to debug it according to the manual (https://wiki.archlinux.org/index.php/sy … emd_errors). When I try to get the log messages for the PID that causes hibernate.service to fail, I don't see anything suspicious in the logs:

$ sudo systemctl status systemd-hibernate.service
systemd-hibernate.service - Hibernate
   Loaded: loaded (/usr/lib/systemd/system/systemd-hibernate.service; static)
   Active: failed (Result: exit-code) since Fri 2014-06-13 14:32:52 CEST; 12min ago
     Docs: man:systemd-suspend.service(8)
  Process: 26712 ExecStart=/usr/lib/systemd/systemd-sleep hibernate (code=exited, status=1/FAILURE)
Main PID: 26712 (code=exited, status=1/FAILURE)

Jun 13 14:32:37 localhost systemd[1]: Starting Hibernate...
Jun 13 14:32:37 localhost systemd-sleep[26712]: Suspending system...
Jun 13 14:32:52 localhost systemd[1]: systemd-hibernate.service: main process exited, code=exited, status=1/FAILURE
Jun 13 14:32:52 localhost systemd[1]: Failed to start Hibernate.
Jun 13 14:32:52 localhost systemd[1]: Unit systemd-hibernate.service entered failed state.

$ sudo journalctl -b _PID=XXXX
-- Logs begin at Thu 2013-09-26 16:12:25 CEST, end at Fri 2014-06-13 14:43:40 CEST. --
Jun 13 14:32:37 localhost systemd-sleep[26712]: Suspending system...

Any ideas?

Offline

Board footer

Powered by FluxBB