You are not logged in.

#1 2013-08-23 22:11:33

Ownaginatious
Member
Registered: 2010-08-28
Posts: 60

What's the systemd equivalent of "HIBERNATE_MODE"?

So my laptop hangs when going into hibernating (Lenovo x120e). The page on it in the Arch Wiki says to get around this, in pm-utils I would have to set the following at

/etc/pm/config.d/hibernate_mode
HIBERNATE_MODE="shutdown"

However, this article is a little outdated, and the cool new thing is to use systemd to handle all this. Unfortunately though, I'm having trouble finding exactly what exactly would be the equivalent to this.

My first guess would be a service file that specifically tells the computer to power-off after initiating hibernate, but I'm not sure.

Anyone have any insight on this?

Offline

#2 2013-08-23 22:29:51

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: What's the systemd equivalent of "HIBERNATE_MODE"?

Not clear above, have you actually tried 'systemctl hibernate', and if so, what was the result?

Offline

#3 2013-08-24 00:54:44

progandy
Member
Registered: 2012-05-17
Posts: 5,318

Re: What's the systemd equivalent of "HIBERNATE_MODE"?

You can configure the actions for suspend, hibernate and hybrid-sleep using /etc/systemd/sleep.conf, see systemd-sleep.conf (5) for details.
The defaults are (taken from code):
* suspend:
... no mode
... state: try mem then standby then freeze
* hibernate:
... mode: try platform then shutdown
... state: disk
* hybrid-sleep:
... mode: try suspend then platform then shutdown
... state: disk
source:
http://cgit.freedesktop.org/systemd/sys … p-config.c
explanations for state and mode:
https://www.kernel.org/doc/Documentatio … states.txt
https://www.kernel.org/doc/Documentatio … swsusp.txt

PS: If you want to use uswsusp or tuxonice, you'll have to create a custom executable similar to systemd-sleep, then disable e.g. the systemd-hibernate.service and replace it with a service that calls your custom handler instead.

Last edited by progandy (2013-08-24 00:59:25)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#4 2013-08-24 01:56:07

Ownaginatious
Member
Registered: 2010-08-28
Posts: 60

Re: What's the systemd equivalent of "HIBERNATE_MODE"?

tomk wrote:

Not clear above, have you actually tried 'systemctl hibernate', and if so, what was the result?

Oh right of course, yes, what I've described is what happens when I run

systemctl hibernate

And thanks progandy, I'll look into what you've posted and update the wiki article once I've figured it out.

Offline

#5 2013-08-24 05:06:35

rufus
Banned
From: san francisco
Registered: 2013-04-20
Posts: 153

Re: What's the systemd equivalent of "HIBERNATE_MODE"?

Im not sure what your question is Ownaginatious.. are you saying systemctl hibernate doesnt shut off?
and or you want to write a new service cant tell...maybe systemctl hybrid-sleep or systemctl suspend  will fill your needs


end ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     'the machine is not the end to the means., we are. In history, in board rooms and politic the greatest  decision and effort
        evolves from passion, lust for life, and a common sense of humanity. Never forget what you are and why'.         -me

Offline

#6 2013-08-25 20:19:56

Ownaginatious
Member
Registered: 2010-08-28
Posts: 60

Re: What's the systemd equivalent of "HIBERNATE_MODE"?

rufus wrote:

Im not sure what your question is Ownaginatious.. are you saying systemctl hibernate doesnt shut off?
and or you want to write a new service cant tell...maybe systemctl hybrid-sleep or systemctl suspend  will fill your needs

Sorry, I should have been more specific. My laptop in particular (Lenovo x120e) has a known issue where when hibernating under Linux, it enters the "hibernating process", in which the screen turns off, but the computer itself doesn't turn off. I guess it gets stuck somewhere. Forcing it off isn't good enough either; the hibernation image gets corrupted.

The way around it is that setting for pm-utils I mentioned above, but since pm-utils is kind of obsolete with systemd around, I was wondering how to setup something similar with systemd.

Last edited by Ownaginatious (2013-08-25 23:45:07)

Offline

#7 2015-11-11 18:16:00

ZombieMeat
Member
Registered: 2015-11-05
Posts: 14

Re: What's the systemd equivalent of "HIBERNATE_MODE"?

I ran into the same problem with a new computer today. In case you are still wondering, write the following to /etc/systemd/sleep.conf

[Sleep]
HibernateState=disk
HibernateMode=shutdown

You can checkout its meaning in systemd-sleep.conf man page

Offline

Board footer

Powered by FluxBB