You are not logged in.
Pages: 1
Hi!
As of kernel 3.6, hybrid-sleep is now fully working. So i was wondering: does systemd support hybrid-sleep? I use only it to suspend/hibernate (i remove upower and pm-utils, relying only on systemctl suspend/hibernate).
Thanks guys!
Ps: I don't know if this is the right place, actually linux 3.6 is in testing, but the question is not regarding it.
Offline
I have the following setup:
I've made a couple of scripts in /usr/local/lib:
/usr/local/lib/sys-power-disk-suspend
#!/bin/sh
echo -n suspend > /sys/power/disk/usr/local/lib/sys-power-disk-platform
#!/bin/sh
echo -n "platform" > /sys/power/diskCopy /usr/lib/systemd/system/systemd-suspend.service and /usr/lib/systemd/system/systemd-hibernate.service to /etc/systemd/system
Modify both files:
/etc/systemd/system/systemd-suspend.service: Add ExecStartPre=/usr/local/lib/sys-power-disk-suspend and change suspend by hibernate.
[Unit]
Description=Suspend
Documentation=man:systemd-suspend.service(8)
DefaultDependencies=no
Requires=sleep.target
After=sleep.target
[Service]
Type=oneshot
ExecStartPre=/usr/local/lib/sys-power-disk-suspend
ExecStart=/usr/lib/systemd/systemd-sleep hibernate/etc/systemd/system/systemd-hibernate.service: Add ExecStartPre=/usr/local/lib/sys-power-disk-platform
[Unit]
Description=Hibernate
Documentation=man:systemd-suspend.service(8)
DefaultDependencies=no
Requires=sleep.target
After=sleep.target
[Service]
Type=oneshot
ExecStartPre=/usr/local/lib/sys-power-disk-platform
ExecStart=/usr/lib/systemd/systemd-sleep hibernateand type as root
systemctl --system daemon-reloadNow I can type systemctl suspend for hybrid-suspend and systemctl hibernate for hibernation and shutdown
The good part is that this setup works on gnome 3.4 too, AFAIK it uses upower for hibernation/suspend and upower now uses systemd when available.
It seems that systemd uses only /sys/power/state for suspend/hibernate and
the hybrid-suspend needs to write "suspend" to /sys/power/disk before. The scripts do just that, and the systemd-suspend.service change to "hibernate" produces an hybrid-suspend instead of a "simple" suspend.
Hope it helps
Last edited by tonitc (2012-10-16 21:08:06)
Offline
A TODO task for systemd was added today called: "introduce hybrid-sleep.target" so I guess it will be soon adressed in the upstream too.
Offline
Yes, i asked Lennart about that and he told me hybrid-sleep will soon be here!
So, only wait!
Offline
Systemd 196 now supports hybrid sleep, although I didn't find anything about how to use it with pm-utils and gnome 3.6. Anyone tried that?
Offline
Pages: 1