<varlistentry>
<term><varname>HibernateMode=</varname></term>
- <term><varname>HybridSleepMode=</varname></term>
- <listitem><para>The string to be written to <filename>/sys/power/disk</filename> by, respectively,
- <citerefentry><refentrytitle>systemd-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
- and
- <citerefentry><refentrytitle>systemd-hybrid-sleep.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
+ <listitem><para>The string to be written to <filename>/sys/power/disk</filename> by <citerefentry>
+ <refentrytitle>systemd-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
More than one value can be specified by separating multiple values with whitespace. They will be
tried in turn, until one is written without error. If none of the writes succeed, the operation will
be aborted.</para>
url="https://www.kernel.org/doc/html/latest/admin-guide/pm/sleep-states.html#basic-sysfs-interfaces-for-system-suspend-and-hibernation">the
kernel documentation</ulink> for more details.</para>
- <para>Note that hybrid sleep corresponds to the <literal>suspend</literal> disk mode. If <varname>HybridSleepMode=</varname>
- is overridden, you might get plain hibernation instead.</para>
-
<para>
<citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
uses the value of <varname>SuspendMode=</varname> when suspending and the value of
static char* const* const sleep_default_mode_table[_SLEEP_OPERATION_CONFIG_MAX] = {
/* Not used by SLEEP_SUSPEND */
[SLEEP_HIBERNATE] = STRV_MAKE("platform", "shutdown"),
- [SLEEP_HYBRID_SLEEP] = STRV_MAKE("suspend", "platform", "shutdown"),
+ [SLEEP_HYBRID_SLEEP] = STRV_MAKE("suspend"),
};
SleepConfig* sleep_config_free(SleepConfig *sc) {
if (strv_contains(sc->modes[SLEEP_HIBERNATE], "suspend"))
log_warning("Sleep mode 'suspend' should not be used by operation %s. Please use %s instead.",
sleep_operation_to_string(SLEEP_HIBERNATE), sleep_operation_to_string(SLEEP_HYBRID_SLEEP));
-
- if (!strv_contains(sc->modes[SLEEP_HYBRID_SLEEP], "suspend"))
- log_warning("Sleep mode 'suspend' is not set for operation %s. This would likely result in a plain hibernation.",
- sleep_operation_to_string(SLEEP_HYBRID_SLEEP));
}
int parse_sleep_config(SleepConfig **ret) {
};
const ConfigTableItem items[] = {
- { "Sleep", "AllowSuspend", config_parse_tristate, 0, &allow_suspend },
- { "Sleep", "AllowHibernation", config_parse_tristate, 0, &allow_hibernate },
- { "Sleep", "AllowSuspendThenHibernate", config_parse_tristate, 0, &allow_s2h },
- { "Sleep", "AllowHybridSleep", config_parse_tristate, 0, &allow_hybrid_sleep },
+ { "Sleep", "AllowSuspend", config_parse_tristate, 0, &allow_suspend },
+ { "Sleep", "AllowHibernation", config_parse_tristate, 0, &allow_hibernate },
+ { "Sleep", "AllowSuspendThenHibernate", config_parse_tristate, 0, &allow_s2h },
+ { "Sleep", "AllowHybridSleep", config_parse_tristate, 0, &allow_hybrid_sleep },
- { "Sleep", "SuspendState", config_parse_strv, 0, sc->states + SLEEP_SUSPEND },
- { "Sleep", "SuspendMode", config_parse_warn_compat, DISABLED_LEGACY, NULL },
+ { "Sleep", "SuspendState", config_parse_strv, 0, sc->states + SLEEP_SUSPEND },
+ { "Sleep", "SuspendMode", config_parse_warn_compat, DISABLED_LEGACY, NULL },
- { "Sleep", "HibernateState", config_parse_warn_compat, DISABLED_LEGACY, NULL },
- { "Sleep", "HibernateMode", config_parse_strv, 0, sc->modes + SLEEP_HIBERNATE },
+ { "Sleep", "HibernateState", config_parse_warn_compat, DISABLED_LEGACY, NULL },
+ { "Sleep", "HibernateMode", config_parse_strv, 0, sc->modes + SLEEP_HIBERNATE },
- { "Sleep", "HybridSleepState", config_parse_warn_compat, DISABLED_LEGACY, NULL },
- { "Sleep", "HybridSleepMode", config_parse_strv, 0, sc->modes + SLEEP_HYBRID_SLEEP },
+ { "Sleep", "HybridSleepState", config_parse_warn_compat, DISABLED_LEGACY, NULL },
+ { "Sleep", "HybridSleepMode", config_parse_warn_compat, DISABLED_LEGACY, NULL },
- { "Sleep", "HibernateDelaySec", config_parse_sec, 0, &sc->hibernate_delay_usec },
- { "Sleep", "SuspendEstimationSec", config_parse_sec, 0, &sc->suspend_estimation_usec },
+ { "Sleep", "HibernateDelaySec", config_parse_sec, 0, &sc->hibernate_delay_usec },
+ { "Sleep", "SuspendEstimationSec", config_parse_sec, 0, &sc->suspend_estimation_usec },
{}
};