Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
XFCE4, upower and upower-pm-utils: can't hibernate
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
jody
l33t
l33t


Joined: 16 Oct 2007
Posts: 668
Location: Switzerland

PostPosted: Mon Aug 29, 2016 1:36 pm    Post subject: XFCE4, upower and upower-pm-utils: can't hibernate Reply with quote

Hi
On a quite freshly installed gentoo i wanted to enable hibernation.
The basic xfce installation did show a "hibernate" button, which let the computer shut down in a "hibernaty" way. But upon restart it would go to the normal login.

I then followed the "hibernate and suspend"-wiki (and i also recompiled the kernel after these changes).
Now, when i type 'pm-hibernate' in terminal, the screen goes dark for a short moment, but the computer does not hibernate - the session continues as if i hadn't typed "pm-hibernate"

In the file "/var/log/pm-suspend.log", after a long list of successful "Running hooks", there is
Code:
Running hook /usr/lib64/pm-utils/sleep.d/99video hibernate hibernate:
/usr/lib64/pm-utils/sleep.d/99video hibernate hibernate: success.

Mon Aug 29 14:52:19 CEST 2016: performing hibernate
s2disk: Could not stat the resume device file. Reason: No such file or directory
Mon Aug 29 14:52:20 CEST 2016: Awake.
Mon Aug 29 14:52:20 CEST 2016: Running hooks for thaw
Running hook /usr/lib64/pm-utils/sleep.d/99video thaw hibernate:
/usr/lib64/pm-utils/sleep.d/99video thaw hibernate: success.
i.e it tries to hibernate, fails becasue it "Could not stat the resume device file", and immediately starts to thaw again.
But i *did* set the swap partition /dev/sda3 for hibernation in the kernel config
Code:
#
# Power management and ACPI options
#
CONFIG_ARCH_HIBERNATION_HEADER=y
# CONFIG_SUSPEND is not set
CONFIG_HIBERNATE_CALLBACKS=y
CONFIG_HIBERNATION=y
CONFIG_PM_STD_PARTITION="/dev/sda3"
CONFIG_PM_SLEEP=y
CONFIG_PM_SLEEP_SMP=y
CONFIG_PM_AUTOSLEEP=y
# CONFIG_PM_WAKELOCKS is not set
CONFIG_PM=y
# CONFIG_PM_DEBUG is not set

Also, in /etc/default/grubi have put
Code:
GRUB_CMDLINE_LINUX_DEFAULT="resume=/dev/sda3"


Another observation regarding upower, pm-utils and upower-pm-utils.
If i understand correctly, OpenRC-users should use upower-pm-utils.
But apparently xfce wants upower, too:
Code:
jody@aim-pteropus ~ $ equery depends upower
 * These packages depend on upower:
xfce-base/xfce4-session-4.12.1 (upower ? >=sys-power/upower-0.9.23)
xfce-base/xfce4-settings-4.12.0 (upower ? >=sys-power/upower-0.9.23)
xfce-extra/xfce4-power-manager-1.5.2 (>=sys-power/upower-0.99.0)

jody@aim-pteropus ~ $ equery depends upower-pm-utils
 * These packages depend on upower-pm-utils:
xfce-base/xfce4-session-4.12.1 (upower ? sys-power/upower-pm-utils)
xfce-base/xfce4-settings-4.12.0 (upower ? sys-power/upower-pm-utils)

jody@aim-pteropus ~ $ equery depends pm-utils
 * These packages depend on pm-utils:
sys-auth/consolekit-1.1.0 (pm-utils ? sys-power/pm-utils)
sys-power/upower-pm-utils-0.9.23-r2 (kernel_linux ? >=sys-power/pm-utils-1.4.1-r2)
xfce-base/xfce4-session-4.12.1 (upower ? sys-power/pm-utils)
xfce-extra/xfce4-power-manager-1.5.2 (sys-power/pm-utils)

This last dependency contradicts the output from emerge:
Code:
jody@aim-pteropus ~ $ emerge --ask xfce-extra/xfce4-power-manager     

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] sys-power/upower-0.99.4  USE="introspection -doc -ios (-selinux)"
[ebuild  N     ] xfce-extra/xfce4-power-manager-1.5.2  USE="policykit -debug -networkmanager -systemd" XFCE_PLUGINS="power"
[blocks B      ] sys-power/upower ("sys-power/upower" is blocking sys-power/upower-pm-utils-0.9.23-r2)

 * Error: The above package list contains packages which cannot be
 * installed at the same time on the same system.

  (sys-power/upower-0.99.4:0/3::gentoo, ebuild scheduled for merge) pulled in by
    >=sys-power/upower-0.99.0 required by (xfce-extra/xfce4-power-manager-1.5.2:0/0::gentoo, ebuild scheduled for merge)

  (sys-power/upower-pm-utils-0.9.23-r2:0/0::gentoo, installed) pulled in by
    sys-power/upower-pm-utils required by @selected


Any ideas on what is wrong here, and how i could get hibernation to work?

Thank You
jody
Back to top
View user's profile Send private message
haarp
Guru
Guru


Joined: 31 Oct 2007
Posts: 535

PostPosted: Tue Aug 30, 2016 11:21 am    Post subject: Reply with quote

I've had lots of problems with upower. upower-pm-utils worked fine, but newer xfce4-power-manager depend on upower. No idea how to solve this either.
Back to top
View user's profile Send private message
derk
Guru
Guru


Joined: 10 Mar 2003
Posts: 347
Location: St Thomas Ontario

PostPosted: Tue Aug 30, 2016 2:37 pm    Post subject: Reply with quote

two things to check is .. the size of your swap partition. Is it big enough to handle all your memory and the stuff already in swap?

Secondly, Which version of consolekit are you using with upower , you'll need version 1.0 or above compiled with the pm-utils flag set.
Back to top
View user's profile Send private message
haarp
Guru
Guru


Joined: 31 Oct 2007
Posts: 535

PostPosted: Sat Sep 03, 2016 8:53 am    Post subject: Reply with quote

Alright, I just checked the new xfce4-power-manager-1.6.0 + upower, suspend/hibernate is still broken.

Facts:

xfce-extra/xfce4-power-manager-1.4.4 works with sys-power/upower-pm-utils. Suspend/Hibernate works fine.

>=xfce-extra/xfce4-power-manager-1.5 requires sys-power/upower instead of upower-pm-utils. Suspend/Hibernate broken.

xfce-extra/xfce4-power-manager-1.4.4 has now been removed from the Portage tree.


What is the proposed solution now? No, "systemd" is not the answer.

(edit: In the meantime, I have re-added xfce4-power-manager-1.4.4 to my overlay.)
Back to top
View user's profile Send private message
derk
Guru
Guru


Joined: 10 Mar 2003
Posts: 347
Location: St Thomas Ontario

PostPosted: Sat Sep 03, 2016 9:35 am    Post subject: Reply with quote

here for kernel 4.7.2 is my working pm-hibernate/suspend .config section

#
# Power management and ACPI options
#
CONFIG_ARCH_HIBERNATION_HEADER=y
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
CONFIG_HIBERNATE_CALLBACKS=y
CONFIG_HIBERNATION=y
CONFIG_PM_STD_PARTITION="/dev/sda3"
CONFIG_PM_SLEEP=y
CONFIG_PM_SLEEP_SMP=y
CONFIG_PM_AUTOSLEEP=y
CONFIG_PM_WAKELOCKS=y
CONFIG_PM_WAKELOCKS_LIMIT=100
CONFIG_PM_WAKELOCKS_GC=y
CONFIG_PM=y
CONFIG_PM_DEBUG=y
# CONFIG_PM_ADVANCED_DEBUG is not set
# CONFIG_PM_TEST_SUSPEND is not set
CONFIG_PM_SLEEP_DEBUG=y
CONFIG_DPM_WATCHDOG=y
CONFIG_DPM_WATCHDOG_TIMEOUT=60
CONFIG_PM_TRACE=y
CONFIG_PM_TRACE_RTC=y
CONFIG_PM_CLK=y
CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y
CONFIG_ACPI=y
CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y
CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y
CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y
# CONFIG_ACPI_DEBUGGER is not set
CONFIG_ACPI_SLEEP=y
CONFIG_ACPI_PROCFS_POWER=y
CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y
# CONFIG_ACPI_EC_DEBUGFS is not set
CONFIG_ACPI_AC=y
CONFIG_ACPI_BATTERY=y
CONFIG_ACPI_BUTTON=y
CONFIG_ACPI_VIDEO=y
CONFIG_ACPI_FAN=y
CONFIG_ACPI_DOCK=y
CONFIG_ACPI_CPU_FREQ_PSS=y
CONFIG_ACPI_PROCESSOR_IDLE=y
CONFIG_ACPI_PROCESSOR=y
CONFIG_ACPI_HOTPLUG_CPU=y
CONFIG_ACPI_PROCESSOR_AGGREGATOR=y
CONFIG_ACPI_THERMAL=y
# CONFIG_ACPI_CUSTOM_DSDT is not set
# CONFIG_ACPI_DEBUG is not set
CONFIG_ACPI_PCI_SLOT=y
CONFIG_X86_PM_TIMER=y
CONFIG_ACPI_CONTAINER=y
CONFIG_ACPI_HOTPLUG_IOAPIC=y
CONFIG_ACPI_SBS=y
CONFIG_ACPI_HED=y
# CONFIG_ACPI_CUSTOM_METHOD is not set
CONFIG_ACPI_BGRT=y
# CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set
# CONFIG_ACPI_NFIT is not set
CONFIG_HAVE_ACPI_APEI=y
CONFIG_HAVE_ACPI_APEI_NMI=y
CONFIG_ACPI_APEI=y
CONFIG_ACPI_APEI_GHES=y
CONFIG_ACPI_APEI_PCIEAER=y
# CONFIG_ACPI_APEI_MEMORY_FAILURE is not set
# CONFIG_ACPI_APEI_EINJ is not set
# CONFIG_ACPI_APEI_ERST_DEBUG is not set
CONFIG_ACPI_EXTLOG=y
CONFIG_PMIC_OPREGION=y
# CONFIG_SFI is not set

you can try using a dbus monitoring tool to see what commands are working or not and whjich services are in place ..

qdbusviewer works well uses qt4 or qt5 .. there are gtk based tools as well

d-feet, dbus-monitor, bustle .. do not know which are in portage

also xfce-extra/xfce4-messenger-plugin can be tried to view the traffic for the calls to consolekit
Back to top
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Sat Sep 03, 2016 11:27 am    Post subject: Reply with quote

Since I am curious about this new xfce4 power-manager(>=1.5.0) helper, which I would like to see ported to MATE - I know unrelated - though,
I still want to see it working. I had a look at the commit log of xfce4-power-manager for the issue report to MATE
and what xfc4 does in the end is to call as root I guess:
xfce4 power manager helper:
# hibernate
/usr/sbin/xfce4-pm-helper --hibernate

# suspend
/usr/sbin/xfce4-pm-helper --suspend
I wonder what happens if you execute these commands ...

[0] https://git.xfce.org/xfce/xfce4-power-manager/commit/?id=9ec0514fd9972373c1875ff3b80054145a445d9f
_________________
hear hear
Back to top
View user's profile Send private message
haarp
Guru
Guru


Joined: 31 Oct 2007
Posts: 535

PostPosted: Sat Sep 03, 2016 4:35 pm    Post subject: Reply with quote

That's interesting, geki.

pkexec xfce4-pm-helper --suspend works with the recent xfce4-power-manager. It also works when suspending by timer. Calling the method directly in qdbusviewer (org.freedesktop.PowerManagement/Suspend) also works.

But manual suspend via the logout dialog or xfce4-session-logout --suspend fails. I wonder what the difference is.
Back to top
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Sat Sep 03, 2016 6:17 pm    Post subject: Reply with quote

Looks like xfce4-session ignores xfce4-power-manager and removed upower in git.
Though, it tries to send a suspend/hibernate query to consolekit/policykit. with proper useflags thereof should do. see:

https://git.xfce.org/xfce/xfce4-session/tree/xfce4-session/xfsm-shutdown.c?h=xfce-4.12&id=xfce4-session-4.12.1#n325

edit #1
I wonder if xfce4-power-manager/upower-0.99 conflicts with ck/polkit. :o
_________________
hear hear


Last edited by geki on Sat Sep 03, 2016 6:27 pm; edited 1 time in total
Back to top
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Sat Sep 03, 2016 6:21 pm    Post subject: Reply with quote

Something like this should do:
Code:
# suspend via dbus command
/org/freedesktop/ConsoleKit/Manager/Suspend

# hibernate via dbus command
/org/freedesktop/ConsoleKit/Manager/Hibernate
check https://github.com/ConsoleKit2/ConsoleKit2/blob/master/src/org.freedesktop.ConsoleKit.Manager.xml#L1
for proper path, I may be wrong! :o

edit #1
Would be good to ask the xfce4-session developers about a org.freedesktop.PowerManagement dbus backend for suspend/hibernate.

edit #2
It would not be hard to patch the dbus backend for suspend/hibernate to query o.f.pm. Just to see if that helps.
_________________
hear hear
Back to top
View user's profile Send private message
derk
Guru
Guru


Joined: 10 Mar 2003
Posts: 347
Location: St Thomas Ontario

PostPosted: Sat Sep 03, 2016 8:44 pm    Post subject: Reply with quote

consolekit-1.1.0 and consolekit-1.1.0-r1 should both work with the pm-utils flag selected .. this allows xfce4-powermanger to do the suspend and hibernate as consolekit has the calls to pm-utils linked in ..

FYI: xfce4-session is patched in git.xfce.org to fix power management .. part of next release .. still a work in progress
Back to top
View user's profile Send private message
haarp
Guru
Guru


Joined: 31 Oct 2007
Posts: 535

PostPosted: Sat Sep 03, 2016 9:55 pm    Post subject: Reply with quote

derk wrote:
FYI: xfce4-session is patched in git.xfce.org to fix power management .. part of next release .. still a work in progress

That was the solution to the mystery. Emerged the live ebuild from the xfce-dev overlay, manual suspend works now!

Relevant commit: https://git.xfce.org/xfce/xfce4-session/commit/?id=e6aafcf444e529648e4542292c29084b3a9e66e5

Many thanks!


Last edited by haarp on Tue Sep 06, 2016 8:13 am; edited 1 time in total
Back to top
View user's profile Send private message
jody
l33t
l33t


Joined: 16 Oct 2007
Posts: 668
Location: Switzerland

PostPosted: Tue Sep 06, 2016 7:40 am    Post subject: Reply with quote

@haarp
i guess i need a little help with the overlays.
I emerged app-portage/layman, did 'sudo layman -L' and 'sudo layman -a xfce-dev'.
I also did 'emerge --sync' and 'eix-update', but i don't see any really new version of xfce4-session: apart from 4.12.1 (which is currently installed) there is a masked 4.12.1-r1 (or is that the one?).
Is there a step i am missing here, i.e. how do i emerge the "live ebuild from the xfce-dev overlay"?

Another question: is xfce-extra/xfce4-power-manager required for manual hibernation?

Thanks
Jody
Back to top
View user's profile Send private message
haarp
Guru
Guru


Joined: 31 Oct 2007
Posts: 535

PostPosted: Tue Sep 06, 2016 8:15 am    Post subject: Reply with quote

You might have to unkeyword it. If you try this:

emerge -av =xfce4-session-9999

it should show you the reason and suggest unkeywording it for you.

xfce4-power-manager is required, but doesn't have to be -9999.
Back to top
View user's profile Send private message
jody
l33t
l33t


Joined: 16 Oct 2007
Posts: 668
Location: Switzerland

PostPosted: Tue Sep 06, 2016 8:53 am    Post subject: Reply with quote

This command didn't work as expected:

Code:
 $ sudo emerge -av =xfce-base/xfce4-session-9999

These are the packages that would be merged, in order:

Calculating dependencies... done!

emerge: there are no ebuilds to satisfy "=xfce-base/xfce4-session-9999".



I think i have properly installed the xfce-dev overlay:
Code:
  $ sudo layman -l
 * xfce-dev                  [Git       ] (git://anongit.gentoo.org/proj/xfc...)


Are there perhaps some steps i have to take so portage (emerge) knows about the overlay?


Regarding xfce4-power-manager: which version would this be? In one of your previous posts you said you have gone back to 1.4.4 - is that the one which is part of your solution?
Back to top
View user's profile Send private message
haarp
Guru
Guru


Joined: 31 Oct 2007
Posts: 535

PostPosted: Tue Sep 06, 2016 10:43 am    Post subject: Reply with quote

Looks like layman repos are not being added to your portage. Not really sure why.

Anything xfce4-power-manager >=1.5.0 should work. I'm using 1.6.0 right now.

You can use 1.4.4, but that means you need upower-pm-utils and regular xfce4-session-4.12.1.
Back to top
View user's profile Send private message
jody
l33t
l33t


Joined: 16 Oct 2007
Posts: 668
Location: Switzerland

PostPosted: Tue Sep 06, 2016 12:52 pm    Post subject: Reply with quote

I managed to install xfce-extra/xfce4-power-manager-1.60 with
Code:
emerge -av ">xfce-extra/xfce4-power-manager-1.5.2"

but that seems not to be enough for hibernation.
What version of xfce4-session works for you?

So my current setup is that i have
  • sys-power/upower-0.99.4
  • xfce-base/xfce4-session-4.12-r1
  • xfce-extra/xfce4-power-manager-1.60

but not sys-power/upower-pm-utils,
Apart from the bad version of xfce4-session, does this look ok?

I guess i'll post the overlay problem in a different forum.

Thanks anyway!
Back to top
View user's profile Send private message
haarp
Guru
Guru


Joined: 31 Oct 2007
Posts: 535

PostPosted: Tue Sep 06, 2016 12:57 pm    Post subject: Reply with quote

xfce4-session-9999 works for me. I also just pushed an earlier version to my overlay (xfce4-session-4.12.1_p20160624) that should also fix this issue, in case you don't want a live ebuild:

https://gitweb.gentoo.org/user/haarp.git/commit/?id=f349b79a1a8f5d3ec45f55aff16c41de9e0aafe5
Back to top
View user's profile Send private message
jody
l33t
l33t


Joined: 16 Oct 2007
Posts: 668
Location: Switzerland

PostPosted: Tue Sep 06, 2016 2:08 pm    Post subject: Reply with quote

haarp, thanks for your support.

I have managed to the overlying properly: i have overlooked this step:
Code:
echo "source /var/lib/layman/make.conf" >> /etc/portage/make.conf
(RTFM!)
After i did this i was able to emerge xfce4-session-9999.

But hibernating still does not work: after i type "sudo pm-hibernate" the screen quickly goes black and then comes to life again, exactly as before.

I noticed in /var/log/pm-suspend:
Code:
Running hook /usr/lib64/pm-utils/sleep.d/98video-quirk-db-handler hibernate hibernate:
nVidia binary video drive detected, not using quirks.
/usr/lib64/pm-utils/sleep.d/98video-quirk-db-handler hibernate hibernate: success.

Running hook /usr/lib64/pm-utils/sleep.d/99video hibernate hibernate:
/usr/lib64/pm-utils/sleep.d/99video hibernate hibernate: success.

Tue Sep  6 16:03:54 CEST 2016: performing hibernate
s2disk: Could not stat the resume device file. Reason: No such file or directory
Tue Sep  6 16:03:56 CEST 2016: Awake.
Tue Sep  6 16:03:56 CEST 2016: Running hooks for thaw
Running hook /usr/lib64/pm-utils/sleep.d/99video thaw hibernate:
/usr/lib64/pm-utils/sleep.d/99video thaw hibernate: success.


Which i don't understand, because i compiled the kernel with
Code:
CONFIG_PM_STD_PARTITION="/dev/sda3"

in my '/etc/default/grub' i have
Code:
GRUB_CMDLINE_LINUX_DEFAULT="resume=/dev/sda3"

and did 'sudo grub-mkconfig -o /boot/grub/grub.cfg'

Any idea what could be missing here?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum