Kodi Community Forum
Linux [SOLVED] Ubuntu 12.04 and Eden: poweroff/shutdown does not work - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52)
+---- Thread: Linux [SOLVED] Ubuntu 12.04 and Eden: poweroff/shutdown does not work (/showthread.php?tid=130419)



[SOLVED] Ubuntu 12.04 and Eden: poweroff/shutdown does not work - sja1440 - 2012-05-01

I cannot get poweroff/shutdown/reboot to work. I have googled the net and have tried:
* adding my xbmc user to the sudoer to allow shutdown/halt/reboot without password
* installed polkit and tried various custom configurations for my xbmc user

I have used successfully these two methods with other releases but this time nothing worked.

Some questions for the forum:
(1) some suggestions on how to make shutdown work?
(2) to help me find a solution does anyone know what mechansim does xbmc actually use to do shutdown?

Some more information regarding my installation:
* Ubuntu 12.04 64-bit server (so no window manager)
* ubuntu repository xbmc (installs Eden)

There are no ppa's in my sources - only standard Ubuntu.

xbmc is run as user xbmc with --standalone using xinit

Clicking on the "power button" on bottom left gives me the options (this is with no polkit installed):
* Exit
* Power off System
* Customer shutdown timer
* Reboot

Clicking on "Power off System" always leads to a restart of XBMC.

Here is a fragment of the xbmc.log
Quote:11:58:28 T:139829470410624 DEBUG: ExecuteXBMCAction : Translating XBMC.Powerdown()
11:58:28 T:139829470410624 DEBUG: ExecuteXBMCAction : To XBMC.Powerdown()
11:58:28 T:139829470410624 DEBUG: CAnnouncementManager - Announcement: OnQuit from xbmc
11:58:28 T:139829470410624 DEBUG: GOT ANNOUNCEMENT, type: 4, from xbmc, message OnQuit
11:58:28 T:139829470410624 NOTICE: Storing total System Uptime
11:58:28 T:139829470410624 NOTICE: Saving settings
11:58:28 T:139829470410624 NOTICE: stop all
11:58:28 T:139829470410624 DEBUG: NetworkMessage - Signaling network services to stop
11:58:28 T:139829470410624 NOTICE: ES: Stopping event server
11:58:28 T:139829470410624 DEBUG: CZeroconfAvahi::doRemoveService named: servers.airplay
11:58:28 T:139829470410624 DEBUG: CZeroconfAvahi::doRemoveService named: servers.airtunes
11:58:28 T:139829470410624 DEBUG: NetworkMessage - Waiting for network services to stop
11:58:28 T:139829470410624 NOTICE: stopping zeroconf publishing
11:58:28 T:139829470410624 NOTICE: Webserver: Stopping...
11:58:28 T:139829470410624 NOTICE: WebServer: Stopped the webserver
11:58:28 T:139829470410624 NOTICE: Webserver: Stopped...




Ubuntu 12.04 and Eden: poweroff/shutdown does not work - WonderStivi - 2012-05-01

Hm... You do realise that you have to configure the shut down-function to actually shut down, and not just quit? At least in a regular install of XBMC. Settings-> System -> Somewhere.


[SOLVED] RE: Ubuntu 12.04 and Eden: poweroff/shutdown does not work - sja1440 - 2012-05-01

In the end I got it to work by fiddling with the/var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla file.

I needed to modify the recipe given at http://wiki.xbmc.org/index.php?title=HOW-TO:Suspend_and_wake_in_Ubuntu as follows:

Make sure the following packages are installed:
Quote:sudo apt-get install policykit-1 upower acpi-support

Now run "pkaction" which lists all of the available actions. Verify that the following are present:
Quote:org.freedesktop.upower.suspend
org.freedesktop.consolekit.system.stop

Create a file /var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla with the following contents:
Quote:[Actions for xbmc user]
Identity=unix-user:xbmc
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes
A quick way of verifying whether <xbmc-user> is authorised or not is to run the following from a <xbmc-user> user terminal:
Quote:pkcheck --action-id org.freedesktop.upower.suspend --process <xbmc-pid>
pkcheck --action-id org.freedesktop.consolekit.system.stop --process <xbmc-pid>
If they both return with no errors then xbmc is authorised. Until I made the change to custom-actions.pkla these two commands returned "Not authorised".

To find out a bit more of what lies behind the custom-actions.pkla read:
Quote:man pklocalauthority
You do not need to make any changes to sudoer.


RE: [SOLVED] Ubuntu 12.04 and Eden: poweroff/shutdown does not work - F.Horst - 2012-05-26

Great,
Thank U


RE: [SOLVED] Ubuntu 12.04 and Eden: poweroff/shutdown does not work - beltin - 2012-09-13

Can anyone off any advice on this - I'm having the same issue with Fedora 17 I've added 'custom-actions.pkla' with the above described contents but no joy.

Many thanks.


RE: [SOLVED] Ubuntu 12.04 and Eden: poweroff/shutdown does not work - beltin - 2012-09-17

bump


RE: [SOLVED] Ubuntu 12.04 and Eden: poweroff/shutdown does not work - djselbeck - 2012-10-11

The problem is, that policykit deprecated this config format. I've had the same problem just now as gentoo updated polkit. What you need now are actions.

Here is mine I hope it helps:

Code:
polkit.addRule(function(action, subject) {
    if (( (action.id.indexOf("org.freedesktop.udisks.") == 0) || (action.id.indexOf("org.freedesktop.upower.")== 0) || (action.id.indexOf("org.freedesktop.consolekit.")== 0) ) &&
        subject.user=="xbmc") {
        return polkit.Result.YES;
    }
});

it is placed under
Code:
/etc/polkit-1/rules.d/50-xbmc.rules



RE: [SOLVED] Ubuntu 12.04 and Eden: poweroff/shutdown does not work - Isulaiman - 2012-10-29

Hi all. I'm running xbmcbuntu on a zbox id80 and I've done the polIcykit, however my htpc, moreoftenthan not will freeze on the xbmc logo on shutdown.

Any suggestions would be greatly appreciated.