Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 550616 - =xfce4-power-manager-1.5.0 Support for sys-power/upower-pm-utils
Summary: =xfce4-power-manager-1.5.0 Support for sys-power/upower-pm-utils
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Jason Zaman
URL:
Whiteboard:
Keywords:
: 554198 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-05-28 04:19 UTC by Nick Andrade
Modified: 2015-07-12 12:30 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
consolekit2-9999.ebuild (consolekit2-9999.ebuild,3.23 KB, text/plain)
2015-05-29 07:04 UTC, Nick Andrade
Details
consolekit-9999.ebuild (consolekit-9999.ebuild,3.13 KB, text/plain)
2015-05-29 10:12 UTC, Derk W te Bokkel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Andrade 2015-05-28 04:19:07 UTC
It seems that =xfce4-power-manager-1.5.0 now requires >=sys-power/upower-0.99.0 with no option to use sys-power/upower-pm-utils instead.  Users that rely on sys-power/upower-pm-utils can't emerge =xfce4-power-manager-1.5.0 without losing hibernate & suspend unless they switch to systemd. 

Reproducible: Always

Steps to Reproduce:
emerge =xfce4-power-manager-1.5.0 
Actual Results:  
[ebuild  N     ] sys-power/upower-0.99.2-r1  USE="introspection -ios (-selinux)" 
[ebuild     U  ] xfce-extra/xfce4-power-manager-1.5.0 [1.4.4]
[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-pm-utils-0.9.23-r2:0/0::gentoo, installed) pulled in by
    sys-power/upower-pm-utils required by @selected

  (sys-power/upower-0.99.2-r1:0/3::gentoo, ebuild scheduled for merge) pulled in by
    >=sys-power/upower-0.9.23 required by (xfce-base/xfce4-settings-4.12.0:0/0::gentoo, installed)
    sys-power/upower required by (lxde-base/lxsession-0.4.9.2-r3:0/0::gentoo, installed)
    >=sys-power/upower-0.9.23 required by (xfce-base/xfce4-session-4.12.1:0/0::gentoo, installed)
    >=sys-power/upower-0.99.0 required by (xfce-extra/xfce4-power-manager-1.5.0:0/0::gentoo, ebuild scheduled for merge)


Expected Results:  
xfce-extra/xfce4-power-manager-1.5.0:0/0::gentoo to be emerged successfully.

More info on upower vs. upower-pm-utils in Gentoo News 2014-06-03-upower-loses-hibernate-suspend-to-systemd
Comment 1 Nick Andrade 2015-05-28 15:25:53 UTC
It appears that upower >=0.99 was made a requirement by upstream in commit 7c5ae951b4f3cf2392b51fb9d8d9aef7274f1d04 (http://git.xfce.org/xfce/xfce4-power-manager/commit/?id=7c5ae951b4f3cf2392b51fb9d8d9aef7274f1d04).  

What's not clear is whether the xfce4 code actually relies on new upower >=0.99 features.  The changes in the commit were mostly just updates to ifdefs that allowed for either upower < 0.99 or upower >= 0.99 to work.  I was able to reverse the logic in the commit, create a patch, build xfce4-power-manager-1.5.0 with it.  So far the only thing that's broken is the panel widget.  Suspend/shutdown works fine (this is on a non-systemd system that uses upower-pm-utils, consolekit, polkit, etc.) as does the xfce4-power-manager-settings.  

In the xfce4-power-manager code I also see reference to "ConsoleKit2" which seems to be a project by Eric Koegel, the author of the commit.  I plan to reach out to the author to see if ConsoleKit2 plus upower >=0.99 will be a supported alternative to provide suspend/hibernate to non-systemd users (in place of upower-pm-utils).

If folks are interested in the patch, let me know.  I plan to continue to work on it (and hopefully fix the widget support).  Right now the patch will only work on a system with upower-pm-utils or upower <0.99 installed however adding ifdefs to also support upower >=0.99 (like in xfce4-power-manager-1.4.4) should be possible.
Comment 2 Jason Zaman gentoo-dev 2015-05-28 19:32:27 UTC
Why do you need upower-pm-utils? I installed xfce-power-manager-1.5.0 and 
sys-power/upower-0.99.2-r1 and suspending works fine.

Looks like the suspending was just pulled into xfce-power-manager itself.

I get this in syslog:
May 28 23:28:01 meriadoc pkexec[25412]: jason: Executing command [USER=root] [TTY=unknown] [CWD=/home/jason] [COMMAND=/usr/lib64/xfce4/session/xfsm-shutdown-helper --suspend]

Can you test out using normal upower?
Comment 3 Nick Andrade 2015-05-28 19:50:53 UTC
Hi Jason, thanks for the response & suggestion.  

To answer your question of why I want upower-pm-utils:
My understanding from 2014-06-03-upower-loses-hibernate-suspend-to-systemd (https://www.gentoo.org/support/news-items/2014-06-03-upower-loses-hibernate-suspend-to-systemd.html) is that, "UPower discontinued hibernate and suspend support in favor of systemd," and while having suspend/resume get rolled into xfce4-power-manager-1.5.0 will work for my laptop's needs (as I primarily run XFCE4), the lack of upower-pm-utils will cause other desktop environments or windows managers on the system to lose that capability.  Personally I also use fluxbox and lxde on occasion, and I would assume that going to upower instead of upower-pm-utils will break suspend (& hibernate, although I don't really use that).  

I will test suspend & hibernate with xfce4-power-manager-1.5.0 & upower-0.99.2-r1 after work tonight (US Pacific time).  I will also look into running xfce4-power-manager-1.5.0 in the background when running fluxbox/lxde to see if that can work as an alternative.
Comment 4 Derk W te Bokkel 2015-05-29 00:24:36 UTC
(In reply to Nick Andrade from comment #1)

> 
> In the xfce4-power-manager code I also see reference to "ConsoleKit2" which
> seems to be a project by Eric Koegel, the author of the commit.  I plan to
> reach out to the author to see if ConsoleKit2 plus upower >=0.99 will be a
> supported alternative to provide suspend/hibernate to non-systemd users (in
> place of upower-pm-utils).
> 



fyi .. Actually does work with Consolekit2 .. git version .. masked version in the tree is too old to work properly I've found.  .. does not require systemd at all ..
I've been running a customized development xfce4-power-manager ebuild .. based on xfce-dev overlay ebuild merged to follow portage tree ebuild changes.. for quite some time ..  works well .. with just upower >=0.99
Comment 5 Derk W te Bokkel 2015-05-29 01:23:13 UTC
fyi

Actually the real work for suspend /hibernate is done by the scripts provided by pm-utils for a non-systemd system .. this is pulled in by xfce4-session :)

just try removing pm-utils for a bit .. no suspend or hibernate at all ..
Comment 6 Nick Andrade 2015-05-29 05:43:05 UTC
(In reply to Jason Zaman from comment #2)
> Why do you need upower-pm-utils? I installed xfce-power-manager-1.5.0 and 
> sys-power/upower-0.99.2-r1 and suspending works fine.
> 
> Looks like the suspending was just pulled into xfce-power-manager itself.
> 
> I get this in syslog:
> May 28 23:28:01 meriadoc pkexec[25412]: jason: Executing command [USER=root]
> [TTY=unknown] [CWD=/home/jason]
> [COMMAND=/usr/lib64/xfce4/session/xfsm-shutdown-helper --suspend]
> 
> Can you test out using normal upower?

Jason, with upower-pm-utils removed and upower installed, I am no longer able to suspend (greyed out in menu, close lid action doesn't work, etc.).  Again, to be clear, this is on a non-systemd setup.

I did confirm the "pkexec /usr/lib64/xfce4/session/xfsm-shutdown-helper --suspend" command does suspend when manually ran (it prompts me for the root password) however I don't see a way to do it from XFCE.
Comment 7 Nick Andrade 2015-05-29 07:02:08 UTC
Okay, with consolekit2 + upower installed, I am able to suspend/hibernate without the upower-pm-utils.  I've created a live ebuild for consolekit2 based on the old ebuild in portage.  It's not really elegant, but it installs.  The only other change I had to make was to remove the "nox11" after pam_ck_connector.so in /etc/pam.d/system-login.  I am using xdm + slim for my DM.
Comment 8 Nick Andrade 2015-05-29 07:04:37 UTC
Created attachment 404258 [details]
consolekit2-9999.ebuild

ConsoleKit2 live ebuild based on consolekit-0.9.2.ebuild.  You'll need to rename files/consolekit-0.2.rc to files/consolekit2-0.2.rc and unisnstall consolekit for it to work.
Comment 9 Jason Zaman gentoo-dev 2015-05-29 07:54:35 UTC
(In reply to Nick Andrade from comment #6)
> Jason, with upower-pm-utils removed and upower installed, I am no longer
> able to suspend (greyed out in menu, close lid action doesn't work, etc.). 
> Again, to be clear, this is on a non-systemd setup.

I didnt do anything special and the suspend button is in the logout/shutdown/suspend menu like normal. You might have to logout and back in for it to realize its using the new one? I also don't use systemd at all, my system is just openrc+lightdm+xfce. As far as I can see, xpm-1.5 and upower is supposed to just work with nothing special.

> I did confirm the "pkexec /usr/lib64/xfce4/session/xfsm-shutdown-helper
> --suspend" command does suspend when manually ran (it prompts me for the
> root password) however I don't see a way to do it from XFCE.

Can you check the output of ck-list-sessions and see if it says you are local and active? maybe its a permissions issue with consolekit?

(In reply to Nick Andrade from comment #8)
> Created attachment 404258 [details]
> consolekit2-9999.ebuild
> 
> ConsoleKit2 live ebuild based on consolekit-0.9.2.ebuild.  You'll need to
> rename files/consolekit-0.2.rc to files/consolekit2-0.2.rc and unisnstall
> consolekit for it to work.

I will take a look and maybe add this to the tree. The development of consolekit2 looks really active but there hasnt been any actual release in a few months :(.
Comment 10 Derk W te Bokkel 2015-05-29 10:12:51 UTC
Created attachment 404266 [details]
consolekit-9999.ebuild

based on masked consolekit-0.9.2 ebuild
Comment 11 Derk W te Bokkel 2015-05-29 10:56:25 UTC
second version .. auto replaces regular consolekit .. and no renaming is required as far as I know .. 

the first version can have a "blocker line added to prevent install with consolekit(1) present" .. .. issue with existing ebuilds in tree needing consolekit versus consolekit2 .. is also eliminated by the second



does your version naming make a difference? .. i.e. not require pm-utils??
Comment 12 Derk W te Bokkel 2015-05-29 14:56:27 UTC
actually looked at the consolekit2 source code .. under tools/linux are scripts which directly call pm-hibernate or pm-suspend if they exist .. also elsewhere in ck-sysdeps-linux.c a call to is a pm-is-supported is found .. so pm-utils should be an optional dependancy for consolekit2 power management to work ..

fyi ..
Comment 13 Nick Andrade 2015-05-29 17:36:04 UTC
(In reply to Derk W te Bokkel from comment #11)
> second version .. auto replaces regular consolekit .. and no renaming is
> required as far as I know .. 
> 
> the first version can have a "blocker line added to prevent install with
> consolekit(1) present" .. .. issue with existing ebuilds in tree needing
> consolekit versus consolekit2 .. is also eliminated by the second
> 
> 
> 
> does your version naming make a difference? .. i.e. not require pm-utils??

If we're able to use the original consolekit name, that's even better (I was planning to test that today).  My consolekit2 ebuild was just a quick & dirty update to what was in portage to see if CK2 works.  I had uninstalled the original consolekit and installed consolekit2-9999 and rebuilt things that depended on the original consolekit via nodeps which seemed to work.

ConsoleKit2 does not appear to require upower-pm-utils for suspend/hibernate to work as I only have upower-0.99.2-r1 installed (upower >=0.99 lacks pm-hibernate/pm-suspend however it does include pm-is-supported).  Again, this was only tested within XFCE4 (started with SLIM/xdm).
Comment 14 Nick Andrade 2015-05-29 17:46:12 UTC
(In reply to Jason Zaman from comment #9)
> I didnt do anything special and the suspend button is in the
> logout/shutdown/suspend menu like normal. You might have to logout and back
> in for it to realize its using the new one? I also don't use systemd at all,
> my system is just openrc+lightdm+xfce. As far as I can see, xpm-1.5 and
> upower is supposed to just work with nothing special.

Hmm, very odd.  I completely logged off XFCE4 after unmerging upower-pm-utils and emerging upower-0.99.2; I even went so far as to restart SLiM.  I don't believe I restarted dbus or consolekit-0.4.6 (this was before I tested CK2), but I guess it's possible that's related to it.

 
> > I did confirm the "pkexec /usr/lib64/xfce4/session/xfsm-shutdown-helper
> > --suspend" command does suspend when manually ran (it prompts me for the
> > root password) however I don't see a way to do it from XFCE.
> 
> Can you check the output of ck-list-sessions and see if it says you are
> local and active? maybe its a permissions issue with consolekit?

I actually checked both ck-list-sessions & xfce4-power-settings --dump, and they both showed proper permissions, but the suspend option was greyed out (the Shutdown option however was selectable and did indeed work).
 

> (In reply to Nick Andrade from comment #8)
> > Created attachment 404258 [details]
> > consolekit2-9999.ebuild
> > 
> > ConsoleKit2 live ebuild based on consolekit-0.9.2.ebuild.  You'll need to
> > rename files/consolekit-0.2.rc to files/consolekit2-0.2.rc and unisnstall
> > consolekit for it to work.
> 
> I will take a look and maybe add this to the tree. The development of
> consolekit2 looks really active but there hasnt been any actual release in a
> few months :(.

Yeah, I noticed that too although I have some hope as there's at least activity in github (most recent change was 12 days ago).  One of my pet peeves are open source apps that don't do regular releases and instead expect downstream distros to use snapshots (FreeRDP, I'm looking at you!).
Comment 15 Derk W te Bokkel 2015-05-29 18:42:24 UTC
> ConsoleKit2 does not appear to require upower-pm-utils for suspend/hibernate
> to work as I only have upower-0.99.2-r1 installed (upower >=0.99 lacks
> pm-hibernate/pm-suspend however it does include pm-is-supported).  Again,
> this was only tested within XFCE4 (started with SLIM/xdm).

no it only requires sys-power/pm-utils and consolekit(2) .. pm-is-supported is provided by pm-utils not upower .. also if your kernel is not set-up properly hibernate /suspend will not work either even if pm-utils is installed    (do not need upower-pm-utils)

clarifications ... above  ... re: >=xfce4-power-manager-1.5 operation
Comment 16 Eric Koegel 2015-06-16 16:09:39 UTC
Hey!

  I've been working with the FreeBSD guys over similar issues. I'll update the xfce docs to help with troubleshooting and understanding what's needed where. But short story is that the order of preference for xfce4-session (xfsm) and xfce4-power-manager (xfpm) is:

logind running ? use it for everything
upower < 0.99 ? use it for suspend/hibernate
upower >= 0.99 + ConsoleKit2 ? use it for everything
consolekit ? use it for shutdown/reboot
nothing ? use internal fallbacks for everything

The internal fallbacks and CK2 use pm-utils (and only pm-utils) for suspend/hibernate since that handles all the hardware quirks and all the other issues.

With newer versions of xfce4-power-manager --debug it should print something like "using xfpm internal suspend backend". xfpm and xfsm fallback code is protected with polkit rules (a change from xfsm in 4.10 that used sudo, to support things like fingerprint readers and auth tokens), org.xfce.power.xfce4-pm-helper and org.xfce.session.xfsm-shutdown-helper respectively and it ships rules that *should* work.

If upower 0.99 being a hard requirement is an issue let us know and we can keep it around for another release.

I am planning on making ConsoleKit2 1.0 stable soon-ish. It won't do the multi-seat and xorg fd passing yet, but that can be added in the future. It's had two dev releases recently, it took a while because the port from dbus-glib to GDBus was a lot of work and changed a lot of the backend code.

Now if any of the above doesn't work, feel free to open bug reports. Sorry it's so complicated...
Comment 17 Jason Zaman gentoo-dev 2015-06-20 12:45:44 UTC
(In reply to Eric Koegel from comment #16)
> logind running ? use it for everything
> upower < 0.99 ? use it for suspend/hibernate
> upower >= 0.99 + ConsoleKit2 ? use it for everything
> consolekit ? use it for shutdown/reboot
> nothing ? use internal fallbacks for everything
>
> I am planning on making ConsoleKit2 1.0 stable soon-ish. It won't do the
> multi-seat and xorg fd passing yet, but that can be added in the future.
> It's had two dev releases recently, it took a while because the port from
> dbus-glib to GDBus was a lot of work and changed a lot of the backend code.

Thanks for the explanation Eric!
I have added 0.9.4 to the tree and it appears to work great. I also added the git version from above with some minor tweaks. The ConsoleKit2 versions are masked still and I will keep it that way until 1.0 I think.

Since there are internal fallbacks for everything, I don't think upower-pm-utils or consolekit2 should be a blocker for  xfce-power-manager. If anyone wants to test, unmask consolekit-0.9.4 and update.

+  20 Jun 2015; Jason Zaman <perfinion@gentoo.org> +consolekit-0.9.4.ebuild,
+  +consolekit-9999.ebuild:
+  version bump to 0.9.4 and live version
Comment 18 Eric Koegel 2015-06-21 05:15:07 UTC
(In reply to Jason Zaman from comment #17)
> Thanks for the explanation Eric!
> I have added 0.9.4 to the tree and it appears to work great. I also added
> the git version from above with some minor tweaks. The ConsoleKit2 versions
> are masked still and I will keep it that way until 1.0 I think.

Awesome, thanks!
 
> Since there are internal fallbacks for everything, I don't think
> upower-pm-utils or consolekit2 should be a blocker for  xfce-power-manager.
> If anyone wants to test, unmask consolekit-0.9.4 and update.

I'm not an expert at ebuilds so I may be wrong here.

In the ConsoleKit2 ebuild you may want to make pm-utils a dependency (just pm-utils not upower-pm-utils) since it's needed for the suspend/hibernate calls. Also you should be able to drop >=dev-libs/dbus-glib-0.100:= as it uses GDBus now (which is in glib).

xfce-power-manager does use pm-utils with it's internal fallack to do suspend/hibernate don't know if you want to add it.
Comment 19 Jason Zaman gentoo-dev 2015-06-21 10:58:03 UTC
I fixed up the deps in xfce4-power-manager-1.5.2 and consolekit2. I am closing this bug now since it seems fixed and is getting cluttered. If there are more issues please open separate bugs for the different components (power manager or consolekit)
Comment 20 Jason Zaman gentoo-dev 2015-07-12 12:30:25 UTC
*** Bug 554198 has been marked as a duplicate of this bug. ***