Systemd Power Management (Arch Linux users are currently screwed)

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Mus_ Offline
Junior Member
Posts: 41
Joined: Mar 2011
Reputation: 0
Post: #1
Hey there,

currently XBMC uses the long unmaintained ConsoleKit for shutting down and rebooting. Arch Linux has recently dropped ConsoleKit from the official repositories, so power management doesn't work at all for Arch Linux users.

Unfortunately I could find neither a bug report nor any talk about this. Are there any plans to support systemd, or more specifically logind, for power management? More and more distributions will drop ConsoleKit in the long-term, so imho it would make perfect sense to support this.

see also:
https://www.archlinux.org/news/consoleki...by-logind/
http://www.freedesktop.org/wiki/Software/systemd/logind
https://bbs.archlinux.org/viewtopic.php?id=152113

thanks and best regards,
mus
find quote
graysky Offline
Senior Member
Posts: 236
Joined: Aug 2009
Reputation: 0
Post: #2
You'll very likely need to open a ticket on the bug tracker for a dev to see and know about this if it isn't there already.
find quote
Ned Scott Offline
Team-Kodi Wiki Guy
Posts: 21,152
Joined: Jan 2011
Reputation: 276
Location: Arizona, USA
Post: #3
While we don't use trac for feature requests anymore, this could be fairly seen as a bug since it will break usage in Arch Linux. So putting this up on Trac wouldn't be a bad idea.

You can make easy links to the XBMC wiki using double brackets around common XBMC words: [[debug log]] = debug log, [[Video library]] = Video library, [[SMB]] = SMB , [[userdata]] = userdata, etc
find quote
Mus_ Offline
Junior Member
Posts: 41
Joined: Mar 2011
Reputation: 0
Post: #4
thanks for the responses, I created a ticket: http://trac.xbmc.org/ticket/13499
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #5
we *can* use ConsoleKit, sure. but we can also use upower, devicekit-power, HAL, +++. we are already fed up with all the 10 gazillion version of this god damn dbus binding distros keep tossing into the mix. until a standard emerges, *for real*, you can carry your distro-specific version yourself.
find quote
Mus_ Offline
Junior Member
Posts: 41
Joined: Mar 2011
Reputation: 0
Post: #6
(2012-11-05 19:31)spiff Wrote:  we *can* use ConsoleKit, sure. but we can also use upower, devicekit-power, HAL, +++. we are already fed up with all the 10 gazillion version of this god damn dbus binding distros keep tossing into the mix. until a standard emerges, *for real*, you can carry your distro-specific version yourself.
I agree that there is kind of a mess regarding all the different *kit/whatever implementations, but I want to make a few points:

- systemd/logind is actually trying to standardize the linux desktop, it is in no way Arch Linux specific. It's just that Arch Linux is afaik the first distro which actually dared to completely drop ConsoleKit. A lot of other distros are switching to systemd and some linux software is even starting to depend on it (Gnome, polkit, udev etc.). Ubuntu is actually the only major distribution who said they don't want to switch (imho: the only reason being that they put a lot of effort into Upstart and don't want to admit that systemd is better). They will have no choice at some point, they can't keep patching ConsoleKit/Gnome and dozens of other packages forever. My point is: XBMC is going to have to support logind sooner or later, because more and more distributions will drop ConsoleKit over time.
- while I don't know if XBMC uses other features of upower, logind can replace its suspend/hibernate functionality. That would be one less dependency for distros running systemd/logind. Wink
- imho: devicekit and HAL have been deprecated for a long time and afaik neither is used by any current distribution, so you might just as well drop the code to clean up some of the mess.
find quote
coling Offline
Junior Member
Posts: 7
Joined: Aug 2011
Reputation: 0
Location: Edinburgh, UK
Post: #7
Hmm, I'm not 100% sure but I don't think there will be major churn here.

polkit (provided it's compiled against systemd) gives the correct info regarding suspend and resume and upower can talk to logind to trigger the suspend process.

Without knowing the code, most of the churn is in middleware. I doubt there will be too much impact here (obviously some changes are needed, I just don't think it'll be huge - and there are still some bugs in upower still shelling out to pm-* stuff even when it's compiled against systemd)
(This post was last modified: 2012-11-09 16:05 by coling.)
find quote
Mus_ Offline
Junior Member
Posts: 41
Joined: Mar 2011
Reputation: 0
Post: #8
(2012-11-09 16:04)coling Wrote:  Hmm, I'm not 100% sure but I don't think there will be major churn here.

polkit (provided it's compiled against systemd) gives the correct info regarding suspend and resume and upower can talk to logind to trigger the suspend process.

Without knowing the code, most of the churn is in middleware. I doubt there will be too much impact here (obviously some changes are needed, I just don't think it'll be huge - and there are still some bugs in upower still shelling out to pm-* stuff even when it's compiled against systemd)
In theory, suspend and hibernate should work since it is handled by upower. The problem is that the XBMC code checks for the existence of ConsoleKit and if it doesn't exist, it won't even try to use upower, although it would work.
logind could actually replace both ConsoleKit and upower regarding power management, since it provides dbus calls for poweroff, reboot, suspend and hibernate (and with the next version also the new hybrid-sleep mode introduced with kernel 3.6).
find quote
topfs2 Offline
Team-Kodi Developer
Posts: 4,088
Joined: Dec 2007
Reputation: 12
Post: #9
Well we actually check for both ConsoleKit and UPower. Mostly since I was not aware there was an alternative to ConsoleKit. Ideally these providers should be decoupled then.
https://github.com/xbmc/xbmc/blob/master...l.cpp#L199

If you wish to do that (decouple them) then adding in systemd/logind or whatever would probably be easier. Could also put in hooks for python to make it even easier to handle distro specifics.

If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
(This post was last modified: 2012-11-20 11:27 by topfs2.)
find quote
denn Offline
Junior Member
Posts: 1
Joined: Nov 2012
Reputation: 0
Post: #10
(2012-11-20 11:27)topfs2 Wrote:  If you wish to do that (decouple them) then adding in systemd/logind or whatever would probably be easier.

Please take a look at the pull request, it implements logind + UPower interface: https://github.com/xbmc/xbmc/pull/1801
find quote
uNiversal Offline
Out of Memory
Posts: 5,603
Joined: Oct 2012
Reputation: 138
Location: Binary pulsar
Post: #11
There is a PR on github for logind + upower https://github.com/xbmc/xbmc/pull/1801

So pull/merge that patch and compile to test.

uNi
(This post was last modified: 2012-11-21 15:07 by uNiversal.)
find quote
Mus_ Offline
Junior Member
Posts: 41
Joined: Mar 2011
Reputation: 0
Post: #12
I noticed that this has been merged with beta2, thanks a lot for this, I didn't think this would still make it into Frodo. Smile
find quote