FS#35729 - [xbmc] polkit rule mentioned in the wiki page should be added in the package

Attached to Project: Community Packages
Opened by Paolo (palmaway) - Sunday, 09 June 2013, 03:30 GMT
Last edited by Sergej Pupykin (sergej) - Thursday, 28 November 2013, 09:53 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

If XBMC is started through the systemd service, the shutdown/reboot/suspend... options are not available anymore. As mentioned in the Arch wiki page for XBMC, this can be solved by installing upower, udisks and polkit and adding the follwing rule:

/etc/polkit-1/rules.d/10-xbmc.rules
-----------------------------
polkit.addRule(function(action, subject) {
if (action.id.match("org.freedesktop.login1.") && subject.isInGroup("power")) {
return polkit.Result.YES;
}
});

polkit.addRule(function(action, subject) {
if (action.id.indexOf("org.freedesktop.udisks") == 0 && subject.isInGroup("storage")) {
return polkit.Result.YES;
}
});
-----------------------------

Could you please add this to the package?

The "xbmc" user created by the package should probably also be added to the upower, udisks groups during creation.

P.S. In version 12.2-4 the rule is still not present, but apparently some user on the wiki page though it was already (see history of the page).
This task depends upon

Closed by  Sergej Pupykin (sergej)
Thursday, 28 November 2013, 09:53 GMT
Reason for closing:  Fixed
Comment by John (graysky) - Sunday, 17 November 2013, 15:58 GMT
@Paolo - The group assignment for the xbmc user is indeed done by the package, see the .install file.
Comment by Paolo (palmaway) - Monday, 18 November 2013, 01:51 GMT
@John you are right, the group assignments are taken care of.

What about the polkit rule? It should be a quite simple modification to the package, is there any particular reason it has not been integrated yet?
Comment by John (graysky) - Monday, 18 November 2013, 09:51 GMT
Our devs don't get paid to do this work, have day jobs, personal lives, etc. Plus, this particular one is pretty minor with a published solution.
Comment by Paolo (palmaway) - Monday, 18 November 2013, 12:58 GMT
@John: excuse me? What has this to do with the bug? Please stick to the topic. There have been two package updates since I posted the bug, so I just assumed there was some reason why it was chosen not to have the polkit rule in the package by default, and that was what I was inquiring about. In any case, for your information, volountary work means that you don't have to take up the job if you don't want to: that is, if you don't want to do it, just let someone else do it. If a dev feels he doesn't have time to apply patches, that's fine, he can just drop the package and let other people take it. In fact, I spent more time writing the bug report than it would be needed to fix the bug.
Comment by John (graysky) - Monday, 18 November 2013, 21:02 GMT
@Paolo - I am confused by your recent reply. In post #2 you asked why the simple mod wasn't added to the package yet. In post #3 I gave a few reasons. How is this off topic?
Comment by Denis Yantarev (denn) - Monday, 18 November 2013, 21:10 GMT
For me it looks more logical to add those rules to polkit. They are not specific to xbmc in fact...
Comment by Paolo (palmaway) - Tuesday, 19 November 2013, 01:19 GMT
@Denis: I agree this is not specific to XBMC, but I have no knowledge on whether it might be useful in other scenarios either. I'm happy with opening another bug report for the polkit package, but I guess it would make sense if the mantainer expressed his opinion here, one way or the other...

@John: by reasons I meant technical reasons: problems the mentioned polkit rule could arise with other packages, for instance, or a decision to put rules in the polkit package only, as suggested by Denis. I'm sorry, but saying that people are busy with their lives adds nothing useful to the discussion here. Actually, it could be said in just every bug report. And since you are not the mantainer of the package, I assume yours is just a speculation. Please, if you have anything related to the polkit rule or the bug to say do so, but really, saying "there's a patch so there's no point in applying it", or "this is minor" (which is not for everyone that has XBMC on headless devices) or "people are busy" (which are your reasons, if I am not mistaken) is quite pointless, in my opinion. But this is really getting off topic.
Comment by Paolo (palmaway) - Tuesday, 19 November 2013, 01:33 GMT
On more note on the group assignements. Reading the install file again, it is actually not taken care of: the user is added to a number of groups indeed, but not to upower and udisks as mentioned on the bug report. Which could make sense, especially considering that upower and udisks are only optional dependencies. The optdepends field, however, is not clear on the implications not having them installed has on the ability to reboot/poweroff the system, and does not mention the necessity of a polkit rule, hence the bugreport.

Loading...