Bug 861976

Summary: "When battery power is critical" in gnome-control-center, "Power" does not allow changes
Product: [openSUSE] openSUSE 13.1 Reporter: Gerald Pfeifer <gp>
Component: GNOMEAssignee: E-mail List <gnome-bugs>
Status: RESOLVED WONTFIX QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: dliang, fcrozat, mcatanzaro
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 13.1   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 882799    
Attachments: Screenshot
System settings -> Power

Description Gerald Pfeifer 2014-02-03 23:56:35 UTC
Created attachment 577012 [details]
Screenshot

Unlike "Automatic suspend", the field "When battery power is critical"
does not allow changing its value but is hard coded to "Power Off".

This is a regression from earlier versions.  I do want to make that
"Suspend to Disk"/"Hibernate", and the GUI should offer this configuration.

See the attached screenshot.
Comment 1 Frederic Crozat 2014-02-04 09:50:00 UTC
Strange, I see the same issue but the default is "hibernate" in dconf ( gsettings get org.gnome.settings-daemon.plugins.power critical-battery-action). 

I wonder if the call to logind "CanHibernate" is failing, causing "hibernate" default not be available..
Comment 2 Atri Bhattacharya 2014-02-04 09:56:16 UTC
Created attachment 577057 [details]
System settings -> Power

Even stranger: on my laptop, the Power modules in system settings has this working just as I expect it to, with hibernate selected by default for when "Battery is critical" and the option to choose "Power off" available from the menu. See attached screenshot.
Comment 3 Gerald Pfeifer 2014-02-04 13:22:06 UTC
(In reply to comment #1)
> Strange, I see the same issue but the default is "hibernate" in dconf (
> gsettings get org.gnome.settings-daemon.plugins.power critical-battery-action). 
> 
> I wonder if the call to logind "CanHibernate" is failing, causing "hibernate"
> default not be available..

What does "upower --dump" give?

Based on your response, I had a look and indeed at first I had

  Daemon:
  daemon-version:  0.9.23
  can-suspend:     yes
  can-hibernate:   no

Then I restarted a program consuming some memory, can-hibernate went
to yes, and now my screenshot looks exactly like Atri's.


In a way this is solved.

Though in a way it is not.  If this is confusing to you and me, I bet
the user experience is even more confusing to a more naive user.

What can we do here?
Comment 4 Frederic Crozat 2014-02-04 13:32:18 UTC
(In reply to comment #3)
> (In reply to comment #1)
> > Strange, I see the same issue but the default is "hibernate" in dconf (
> > gsettings get org.gnome.settings-daemon.plugins.power critical-battery-action). 
> > 
> > I wonder if the call to logind "CanHibernate" is failing, causing "hibernate"
> > default not be available..
> 
> What does "upower --dump" give?
> 
> Based on your response, I had a look and indeed at first I had
> 
>   Daemon:
>   daemon-version:  0.9.23
>   can-suspend:     yes
>   can-hibernate:   no
> 
> Then I restarted a program consuming some memory, can-hibernate went
> to yes, and now my screenshot looks exactly like Atri's.

Hmm, I also have can-hibernate as "no"

> In a way this is solved.
> 
> Though in a way it is not.  If this is confusing to you and me, I bet
> the user experience is even more confusing to a more naive user.
> 
> What can we do here?

I've checked systemd code and it only allows hibernation if memory used (Active in /proc/meminfo) is below 98% of the swap partition size.

I'm not sure how to improve this, some possible solutions:
- specify in the configure UI that current memory usage is higher than swap size, not allowing hibernation (although user won't really be able to change that)
- still allow hibernation but when it is done as "critical" and if conditions aren't met anymore, push some warning and after some delay, shutdown the system (not great)
Comment 5 Gerald Pfeifer 2014-02-16 22:39:34 UTC
Thanks for digging into this, Fred!

> I'm not sure how to improve this, some possible solutions:
> - specify in the configure UI that current memory usage is higher than swap
> size, not allowing hibernation (although user won't really be able to change
> that)

YES, absolutely please.  My primary challenge and frustration as a user
was that it just seemed not to work without any indication on why (not).

So, regardless of anything else, if we do not support something which
generally works, explain, even if briefly.

> - still allow hibernation but when it is done as "critical" and if conditions
> aren't met anymore, push some warning and after some delay, shutdown the system
> (not great)

My preference would be to still allowing me to set the configuration to
hibernate, even if currently not possible, and then fall back as you 
indicate.
Comment 6 Frederic Crozat 2014-02-17 09:36:36 UTC
David, could you have a look at it ?
Comment 7 Michael Catanzaro 2014-07-02 02:52:52 UTC
Has this been reported upstream?
Comment 8 Tomáš Chvátal 2018-04-12 13:32:24 UTC
This version of openSUSE changed to end-of-life (EOL [1]) status. As such
it is no longer maintained, which means that it will not receive any
further security or bug fix updates.
As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
openSUSE, or consider the bug still valid, please feel free to reopen this
bug against that version, or open a new ticket.

Thank you for reporting this bug and we are sorry it could not be fixed
during the lifetime of the release.

[1] https://en.opensuse.org/Lifetime