Bug 1007059 - systemd-logind should make sure 'CanHibernate' is false if not enough swap space for all of RAM
Summary: systemd-logind should make sure 'CanHibernate' is false if not enough swap sp...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 18
Hardware: All
OS: Linux
urgent
urgent
Target Milestone: ---
Assignee: Zbigniew Jędrzejewski-Szmek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-11 19:57 UTC by Wolfgang Ulbrich
Modified: 2013-10-09 02:16 UTC (History)
9 users (show)

Fixed In Version: systemd-204-16.fc19
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-10-09 02:16:11 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Wolfgang Ulbrich 2013-09-11 19:57:04 UTC
Description of problem:
systemd-login report 'CanHibernate' on a system without swap partition!
Since mate-session-manager is fixed to support suspend/hibernate without using upower, see http://pkgs.fedoraproject.org/cgit/mate-session-manager.git/commit/?id=b3d61935a5a60c68de65b30bf094a95cc6cd2e9c  ,
the shutdown dialog from mate-session shows me the hibernate button.
But i don't use a swap partition, in result using this button send my system as expected in a unusable state, hard reset is needed.
This affected all current fedora versions (f20/19/18)
Normaly i don't have a hibernate option in f19/18 with using upower.
A local build mate-session-manager with this patch gives me th button in f18/19 too.

f19 outputs:
[rave@mother ~]$ qdbus --system org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.CanHibernate
false

[rave@mother ~]$ qdbus --system org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.CanHibernate
yes

I will post outputs for f20/18 later


Version-Release number of selected component (if applicable):
all current versions for F20/18/19 of systemd

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
hibernate button in mate's shutdown dialog

Expected results:
no hibernate button in mate's shutdown dialog

Additional info:
mate-seesion-manager was needed to be fix for this report
https://bugzilla.redhat.com/show_bug.cgi?id=1005234
since upower-0.9.21 is build with --enable-deprecated

Comment 1 Wolfgang Ulbrich 2013-09-11 20:32:11 UTC
f18 outputs:

[rave@mother ~]$ qdbus --system org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.CanHibernate
false
[rave@mother ~]$ qdbus --system org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.CanHibernate
yes

Comment 2 Wolfgang Ulbrich 2013-09-11 20:36:30 UTC
f20 outputs:

[rave@mother ~]$ qdbus --system org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.CanHibernate
false
[rave@mother ~]$ qdbus --system org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.CanHibernate
challenge

Comment 3 Wolfgang Ulbrich 2013-09-11 20:38:02 UTC
If you need more info's or debuging results please let me know.

Comment 4 Lennart Poettering 2013-09-12 18:59:37 UTC
What does "cat /sys/power/state" say for you?

Comment 5 Lennart Poettering 2013-09-12 19:04:36 UTC
Hmm, so UPower seems to report hibernate support only if the RAM in the system is 98% or less of the swap space. We probably should something similar in logind. Ugly...

Comment 6 Lennart Poettering 2013-09-12 19:06:54 UTC
http://cgit.freedesktop.org/upower/tree/src/up-daemon.c#n613

Comment 7 Zbigniew Jędrzejewski-Szmek 2013-09-12 19:58:41 UTC
The OP said that he has now swap... So I don't think swap size is an issue here.

Comment 8 Rex Dieter 2013-09-12 20:02:23 UTC
Where did he say that?

Comment 9 Wolfgang Ulbrich 2013-09-12 20:12:55 UTC
f19 output:
[rave@mother ~]$ cat /sys/power/state
freeze standby mem disk

I 've 8 GB ram, for this reason i don't use a swap partiton which is useless in most cases if ram is overload, before the ram is save to disk the system crashed, imo
But this has never been happen here. For me is hibernate a old remnant from the last century.

Comment 10 Wolfgang Ulbrich 2013-09-12 20:15:03 UTC
(In reply to Wolfgang Ulbrich from comment #9)
> f19 output:
> [rave@mother ~]$ cat /sys/power/state
> freeze standby mem disk
> 
> I 've 8 GB ram, for this reason i don't use a swap partiton which is useless
> in most cases if ram is overload, before the ram is save to disk the system
> crashed, imo
> But this has never been happen here. For me is hibernate a old remnant from
> the last century.
i meant using a swap partition is a remnant from the last century.

Comment 11 Wolfgang Ulbrich 2013-09-12 20:18:38 UTC
By the way, our friends from gentoo/mate uptream did confirmed this, exactly the same results.

Comment 12 Wolfgang Ulbrich 2013-09-12 21:57:02 UTC
Hmm, i'm still wondering about the new title.
I never said     swap < ram !!!
I said           swap = 0
My old mathematics teachers said this is different :P

Again in clear words.

I don't have a swap partition.

Comment 13 Kay Sievers 2013-09-13 01:16:05 UTC
(In reply to Wolfgang Ulbrich from comment #12)
> Hmm, i'm still wondering about the new title.
> I never said     swap < ram !!!
> I said           swap = 0
> My old mathematics teachers said this is different :P
> 
> Again in clear words.
> 
> I don't have a swap partition.

But then your swap is still smaller than your ram. So all is fine. :)

Comment 14 Zbigniew Jędrzejewski-Szmek 2013-09-13 23:59:59 UTC
Upstream fix in http://cgit.freedesktop.org/systemd/systemd/commit/?id=69ab808.

Comment 15 Wolfgang Ulbrich 2013-09-17 19:35:27 UTC
new results f20 with systemd-207-3.fc20

[rave@mother ~]$ qdbus --system org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.CanHibernate
false
[rave@mother ~]$ qdbus --system org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.CanHibernate
na

The hibernate button in MATE's shutdown dialog is also gone.
Fixed for me.
Hopefully you will also update f19/18 with the fix for 'fixed swap activation' rhbz#1008604

Comment 16 Fedora Update System 2013-10-02 12:12:48 UTC
systemd-208-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/systemd-208-1.fc20

Comment 17 Wolfgang Ulbrich 2013-10-02 15:19:00 UTC
Can we expect also a fix for f18/19 ?

Comment 18 Fedora Update System 2013-10-03 01:10:23 UTC
Package systemd-208-2.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-208-2.fc20'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-18172/systemd-208-2.fc20
then log in and leave karma (feedback).

Comment 19 Fedora Update System 2013-10-04 02:01:16 UTC
systemd-208-2.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 20 Wolfgang Ulbrich 2013-10-04 07:58:14 UTC
This issue exists on f19 boxes!

Comment 21 Fedora Update System 2013-10-06 22:16:07 UTC
systemd-204-16.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/systemd-204-16.fc19

Comment 22 Wolfgang Ulbrich 2013-10-06 23:26:08 UTC
Thanks for fixing it for f19, do you plan an update for f18 too?

Comment 23 Fedora Update System 2013-10-08 11:38:22 UTC
systemd-204-16.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 24 Wolfgang Ulbrich 2013-10-08 11:43:56 UTC
F18 needs also to be fixed.

Comment 25 Zbigniew Jędrzejewski-Szmek 2013-10-09 02:16:11 UTC
It is just too much work. The file that this code lives in wasn't even there in systemd-201, and those patches generate copious conflicts when applied. F20 is round the corner, and we have too many bugs present in current releases. Sorry.


Note You need to log in before you can comment on or make changes to this bug.