Kodi Community Forum

Full Version: Cannot poweroff, suspend, restart
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone,

I know this has been discussed many times. I've already followed the hints and instructions here and here, without success.

But first a little background: I just installed a minimal version of Ubuntu 14.04 LTS and XBMC 13.1.
At first, the only power-menu entry was "Exit" - until I added
Code:
xbmc ALL=(ALL) NOPASSWD:ALL
at the end of my /etc/sudoers file.

Now all the menu entries (like Shutdown, Suspend, Restart) show up, but they don't work: Suspend doesn't do anything, Shutdown and Restart just restart XBMC instead of the whole machine.

When I noticed
Code:
org.freedesktop.consolekit.system.stop
was missing from my output of
Code:
pkaction
I decided to come here for help as it looks like some things changed since these instructions were valid.

My debug log doesn't show anything specific when clicking Suspend in the menu:
Code:
11:03:02 T:139934441428928   DEBUG: Keyboard: scancode: 0x74, sym: 0x0112, unicode: 0x0000, modifier: 0x0
11:03:02 T:139934441428928   DEBUG: OnKey: down (0xf081) pressed, action is Down
11:03:02 T:139933947488000    INFO: CActiveAESink::OpenSink - initialize sink
11:03:02 T:139933947488000   DEBUG: CActiveAESink::OpenSink - trying to open device ALSA:hdmi:CARD=NVidia,DEV=1
11:03:02 T:139933947488000   DEBUG: CAESinkALSA::GetChannelLayout - Input Channel Count: 2 Output Channel Count: 2
11:03:02 T:139933947488000   DEBUG: CAESinkALSA::GetChannelLayout - Requested Layout: FL,FR
11:03:02 T:139933947488000   DEBUG: CAESinkALSA::GetChannelLayout - Got Layout: FL,FR
11:03:02 T:139933947488000    INFO: CAESinkALSA::Initialize - Attempting to open device "hdmi:CARD=NVidia,DEV=1"
11:03:02 T:139933947488000    INFO: CAESinkALSA::Initialize - Opened device "hdmi:CARD=NVidia,DEV=1,AES0=0x04,AES1=0x82,AES2=0x00,AES3=0x00"
11:03:02 T:139933947488000    INFO: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
11:03:02 T:139933947488000    INFO: CAESinkALSA::InitializeHW - Using data format AE_FMT_S32NE
11:03:02 T:139933947488000   DEBUG: CAESinkALSA::InitializeHW - Request: periodSize 2048, bufferSize 8192
11:03:02 T:139933947488000   DEBUG: CAESinkALSA::InitializeHW - Got: periodSize 2048, bufferSize 8192
11:03:02 T:139933947488000   DEBUG: CAESinkALSA::InitializeHW - Setting timeout to 186 ms
11:03:02 T:139933947488000   DEBUG: CAESinkALSA::GetChannelLayout - Input Channel Count: 2 Output Channel Count: 2
11:03:02 T:139933947488000   DEBUG: CAESinkALSA::GetChannelLayout - Requested Layout: FL,FR
11:03:02 T:139933947488000   DEBUG: CAESinkALSA::GetChannelLayout - Got Layout: FL,FR
11:03:02 T:139933947488000   DEBUG: CActiveAESink::OpenSink - ALSA Initialized:
11:03:02 T:139933947488000   DEBUG:   Output Device : HDA NVidia
11:03:02 T:139933947488000   DEBUG:   Sample Rate   : 44100
11:03:02 T:139933947488000   DEBUG:   Sample Format : AE_FMT_S32NE
11:03:02 T:139933947488000   DEBUG:   Channel Count : 2
11:03:02 T:139933947488000   DEBUG:   Channel Layout: FL,FR
11:03:02 T:139933947488000   DEBUG:   Frames        : 2048
11:03:02 T:139933947488000   DEBUG:   Frame Samples : 4096
11:03:02 T:139933947488000   DEBUG:   Frame Size    : 8
11:03:03 T:139934441428928   DEBUG: Keyboard: scancode: 0x24, sym: 0x000d, unicode: 0x000d, modifier: 0x0
11:03:03 T:139934441428928   DEBUG: OnKey: return (0xf00d) pressed, action is Select

Any help is greatly appreciated!
See: http://forum.xbmc.org/showthread.php?tid=165707 for the policykit file and also install pm-utils.
(2014-06-29, 11:14)fritsch Wrote: [ -> ]See: http://forum.xbmc.org/showthread.php?tid=165707 for the policykit file and also install pm-utils.

Thank you for your quick reply. Do you mean this?
Code:
[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

I already have this and
Code:
pkcheck --action-id org.freedesktop.upower.suspend --process <xbmc-pid>
doesn't give me any errors, so the action seems to be authorized for the user xbmc.

I don't have an action org.freedesktop.consolekit.system.stop, though. Do I need to install consolekit for this to work?

I installed pm-utils.
yes, you need to
(2014-06-29, 11:22)fritsch Wrote: [ -> ]yes, you need to

So consolekit also has to do with suspend or is this only for the shutdown command? I will try this as soon as I'm at home.
This worked perfectly! consolekit was the clue. Let me give you a quick summary of what I did to make this work after a minimal installation of Ubuntu 14.04 LTS:

Code:
apt-get install upower acpi-support pm-utils consolekit

/etc/polkit-1/localauthority/50-local.d/custom-actions.pkla
Code:
[Actions for xbmc user]
Identity=unix-user:xbmc
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes

Note that I removed the udisks-part of the actions included in other postings, because I don't have that action when listing with pkaction.

Thanks for the support!
I don't think the /etc/sudoers change is needed.
sudo stuff is definitely not needed
Okay. This was one of the first things I tried when my power-menu entries were missing completely. Made them appear, but not working.
I will try it out without the changes in /etc/sudoers and report back!

Edit: Of course these guys know what they're talking about. No changes needed in /etc/sudoers.