Linux - [SOLVED] Ubuntu 12.04 and Eden: poweroff/shutdown does not work

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
sja1440 Offline
Junior Member
Posts: 13
Joined: Aug 2011
Reputation: 0
Post: #1
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...
(This post was last modified: 2012-05-01 15:04 by sja1440.)
find quote
WonderStivi Offline
Junior Member
Posts: 19
Joined: Apr 2009
Reputation: 0
Post: #2
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.
find quote
sja1440 Offline
Junior Member
Posts: 13
Joined: Aug 2011
Reputation: 0
Post: #3
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..._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.freedesk​top.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.
find quote
F.Horst Offline
Junior Member
Posts: 18
Joined: Jul 2011
Reputation: 0
Post: #4
Great,
Thank U
find quote
beltin Offline
Junior Member
Posts: 6
Joined: Sep 2010
Reputation: 0
Post: #5
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.
find quote
beltin Offline
Junior Member
Posts: 6
Joined: Sep 2010
Reputation: 0
Post: #6
bump
find quote
djselbeck Offline
Junior Member
Posts: 20
Joined: Nov 2008
Reputation: 0
Post: #7
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
(This post was last modified: 2012-10-11 15:37 by djselbeck.)
find quote
Isulaiman Offline
Junior Member
Posts: 25
Joined: Oct 2012
Reputation: 0
Post: #8
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.
find quote