• 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8
How to make XBMC shutdown Linux?
#76
Quote:Finally! Solved my problem (see
Maked sense to me. Before you fixed it, could you see any permissions errors in the log?

Quote:I tried to add my user "xbmc" to sudo group and it nicely tells that
"xbmc" already is in that group.....weird...
Well..adding the user to sudo group does not make the user root. I am not sure what you find weird.
Reply
#77
vikjon0 Wrote:Maked sense to me. Before you fixed it, could you see any permissions errors in the log?


Well..adding the user to sudo group does not make the user root. I am not sure what you find weird.

Thought that being in sudo group would give that groups privileges and
not needing sudo command to perform actions.

So I am missing something..

Br, Zemy
Reply
#78
xbmc ALL=(ALL) ALL

Means that you can run any command under sudo AFTER you enter the 'xbmc' user password.

xbmc ALL=(ALL) NOPASSWD: SHUTDOWN_CMDS

Means you don't need to use the password. XBMC has no way of entering the password for sudo when executing a command. Any command you want to run with XBMC for xbmc needs to be in the cmds list to run without a password.

If you want pm-suspend to work, I'll leave it as an exercise to the reader on what you need to change in this line:

Code:
Cmnd_Alias SHUTDOWN_CMDS = /sbin/shutdown, /sbin/halt, /sbin/reboot, /sbin/poweroff
Code:
GRANT ALL PRIVILEGES ON `xbmc_%`.* TO 'xbmc'@'%';
IF you have a mysql problem, find one of the 4 dozen threads already open.
Reply
#79
darkscout Wrote:xbmc ALL=(ALL) ALL

Means that you can run any command under sudo AFTER you enter the 'xbmc' user password.

xbmc ALL=(ALL) NOPASSWD: SHUTDOWN_CMDS

Means you don't need to use the password. XBMC has no way of entering the password for sudo when executing a command. Any command you want to run with XBMC for xbmc needs to be in the cmds list to run without a password.

If you want pm-suspend to work, I'll leave it as an exercise to the reader on what you need to change in this line:

Code:
Cmnd_Alias SHUTDOWN_CMDS = /sbin/shutdown, /sbin/halt, /sbin/reboot, /sbin/poweroff

Yes, the pm-suspend is added to that line. Just checked that the commands are in my Natty installation in /usr/sbin/ directory... at least this pm-suspend
Br, Zemy
Reply
#80
And you can run
Code:
sudo pm-suspend

As user xbmc, from ssh and it works perfectly, but it won't run from XBMC?
Code:
GRANT ALL PRIVILEGES ON `xbmc_%`.* TO 'xbmc'@'%';
IF you have a mysql problem, find one of the 4 dozen threads already open.
Reply
#81
If you can't run pm-suspend from tty without entering a password when logged in as xbmc, then it definitely sounds like a permissions problem.

Can you post the contents of the following:

/etc/sudoers
/var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla
/var/lib/polkit-1/localauthority/50-local.d/20-xbmclive.pkla
Reply
#82
darkscout Wrote:And you can run
Code:
sudo pm-suspend

As user xbmc, from ssh and it works perfectly, but it won't run from XBMC?

Just this way it works currently.

Br, Zemy
Reply
#83
Without entering a password?
Code:
GRANT ALL PRIVILEGES ON `xbmc_%`.* TO 'xbmc'@'%';
IF you have a mysql problem, find one of the 4 dozen threads already open.
Reply
#84
darkscout Wrote:Without entering a password?

With entering password.
Reply
#85
Then your sudoers isn't setup correctly.
Fix that, it'll fix your problem.
Code:
GRANT ALL PRIVILEGES ON `xbmc_%`.* TO 'xbmc'@'%';
IF you have a mysql problem, find one of the 4 dozen threads already open.
Reply
#86
So here is my sudoers file:

# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL) ALL
xbmc ALL=(ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo ALL=(ALL) ALL

#includedir /etc/sudoers.d
### XBMC-specific configuration ###
# XBMC
Cmnd_Alias SHUTDOWN_CMDS = /user/sbin/shutdown, /usr/sbin/reboot, /usr/sbin/halt, /usr/sbin/pm-suspend # xbmc
Cmnd_Alias MOUNT_CMDS = /bin/mount, /bin/umount # xbmc
xbmc ALL=(ALL) NOPASSWD: SHUTDOWN_CMDS, MOUNT_CMDS # xbmc
xbmc ALL=(ALL) ALL # xbmc

If someone could point the error...I feel like I am blind to my mistake there.

Br, Zemy
Reply
#87
I believe it may be because you have a "xbmc ALL=(ALL) ALL" before everything. I'd assume that it was top down execution. Try commenting the first one out. Otherwise it looks near identical to mine.
Code:
GRANT ALL PRIVILEGES ON `xbmc_%`.* TO 'xbmc'@'%';
IF you have a mysql problem, find one of the 4 dozen threads already open.
Reply
#88
Hello there,
following the thread, trying stuff out but I'm still stuck wih a black cross over a black screen when I try to shutdown from xbmc Sad

sudoers
Quote:#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL:ALL) ALL
#xbmc ALL=(ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

#includedir /etc/sudoers.d
### XBMC-specific configuration ###
# XBMC
Cmnd_Alias SHUTDOWN_CMDS = /sbin/shutdown, /sbin/reboot, /sbin/halt, /sbin/poweroff, /sbin/pm-suspend # XBMC
xbmc ALL=(ALL) NOPASSWD: SHUTDOWN_CMDS, MOUNT_CMDS # XBMC
xbmc ALL=(ALL) ALL

custom_actions
Quote:[Actions for xbmc user]
Identity=unix-user:xbmc
Action=org.freedesktop.devicekit.power.*,org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*
ResultActive=yes
ResultAny=auth_admin
ResultInactive=yes

the 20xbmclive has been renamed to .old as per a suggestion earlier that it is useless and custom_actions should be used instead.

Ubuntu 11.04 and "vanilla" install ( ie no modified startup scripts etc )

Where did I went wrong Sad
Reply
#89
Zemy Wrote:Lucky You, I am still in middle of nowhere with Natty. In console I can do every trick with sudo command but not without. It always tells me that;
"Need to be root"
I tried to add my user "xbmc" to sudo group and it nicely tells that
"xbmc" already is in that group.....weird...

Br, Zemy

Well, let me give some specifics. My software setup is *not* entirely the same between post 63 and post 74!!

In post 63 I went from a completely working install on an external antique eSata 250GB HDD, to a 32GB SSD.

I wanted to recreate the setup from the HDD on the SSD by installing everything fresh. So that is what I describe in post 63. The only thing different between the "old" HDD install and the "new" SSD install (as described in post 63) was the date of XBMC. HDD = Compiled 24 FEB 2011 / SSD = 31 Compiled 31 MAY 2011.

But before I found my "solution" (post 74) I also found out that builds *after* MAY 16, don't work anymore with the Aeon MQ2 skin (missing submenu's).

So I decided to install everything fresh again on the SSD, trying to get hold-of an earlier build (with bluray support!) for Ubuntu 10.10 x64. Nothing to find on the ppa I got if from, only the latest compiled build! But I didn't want to compile myself again (on the SSD).

So I took the old .deb files (from my working setup on the antique HDD) from its /var/cache/apt/archives directory - and installed them (fixing depencies with sudo apt-get -f install) on my SSD.

So right before post 74 I had:
  • Ubuntu 10.10 x64 minimal
  • Xbmc-standalone from this ppa, but now build FEB 24

The solution from post 63 also did *not* work on the above (FEB 24) install, only with the small additions I posted in post 74.

Strange, because I essentialy recreated the working install from the HDD. The only difference was the Kernel (since Ubuntu minimal takes its sources online during install):
Old working HDD install - 2.6.35-25-generic #44-Ubuntu
Non-working recreated SSD install - 2.6.35-28-generic #50-Ubuntu
Everything else (xbmc, policykit-1, upower etc) were the same versions!

So now I can't really conclude what the problem is/was!

Maybe my "solution" worked perfectly as well with the later xbmc build, but also maybe not! Was it the later build from xbmc that messed things up? Or not? Doesn't really seem that logical to me, but hey, never rule things out Big Grin.

Anyway, as said, got it working now.

vikjon0 Wrote:Maked sense to me. Before you fixed it, could you see any permissions errors in the log?

No, that is the strange thing. My logs looked much the same as everyone else posted here. No errors related to permissions and such.
Reply
#90
Slammy Wrote:Hello there,
following the thread, trying stuff out but I'm still stuck wih a black cross over a black screen when I try to shutdown from xbmc Sad

sudoers


custom_actions


the 20xbmclive has been renamed to .old as per a suggestion earlier that it is useless and custom_actions should be used instead.

Ubuntu 11.04 and "vanilla" install ( ie no modified startup scripts etc )

Where did I went wrong Sad


Try to find the differences with your post, and the stuff below:

Code:
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset

# Host alias specification

# User alias specification

# Cmnd alias specification
Cmnd_Alias SHUTDOWN_CMDS = /sbin/shutdown, /sbin/reboot, /sbin/halt, /sbin/poweroff, /sbin/pm-suspend

# User privilege specification
root ALL=(ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo ALL=(ALL) ALL

#includedir /etc/sudoers.d
### XBMC-specific configuration ###
xbmc ALL=(ALL) NOPASSWD: SHUTDOWN_CMDS, MOUNT_CMDS



Code:
[Actions for xbmc user]
Identity=unix-user:xbmc
Action=org.freedesktop.devicekit.power.*;org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*
ResultActive=yes
ResultAny=auth_admin
ResultInactive=yes

Hint:
ALL=(ALL:ALL) ALL versus ALL=(ALL) ALL
Action=org.freedesktop.devicekit.power.*,org versus Action=org.freedesktop.devicekit.power.*;org
consolekit.system. *;org versus consolekit.system.*;org
etc.

, versus ; and spaces etc.

Also the command pkaction gives output?
Reply
  • 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8

Logout Mark Read Team Forum Stats Members Help
How to make XBMC shutdown Linux?0