Can't get XBMC to shut down
#1
Hello to all. I have a problem and was wondering if anyone has had this and knew how to fix it.

First off let me state for the record that i am indeed a linux newb, but i am trying to learn how to use it.

I am running xbmc 9.11 R26018 on a minimal install of karmic (2.6.31-17 generic core). I installed using biptn's script found here:
http://forum.xbmc.org/showpost.php?p=459...tcount=176

I know, I know it's cheating, but like I said, I'm a complete newb and couldn't set it up as well as this script does.

Everything works great, other than the fact that i can no longer shut down the computer from xbmc shutdown menu. When I use the shutdown, exit or reboot options it exits xbmc and sends me to what i understand is the display manager(black screen with cursor). I also have my remote setup to shutdown using: XBMC.shutdown(), and yet it still brings me back to the window manager. Using hibernate or suspend just quickly reboots xbmc and I'm back where I started. I am able to restart xbmc, or boxee for that matter, from the window manager because i have irexec setup to do so from my remote so there's no problem there.

I can shut the computer off by pressing the button, but doing so i lose all of my settings and no matter which skin I am currently using it always resets back to confluence.

I've tried almost anything I can think of with my limited linux knowledge to no avail including adding the xbmc user to the policy kit settings like so:

Code:
sudo polkit-auth --user xbmc --grant org.freedesktop.hal.power management.suspend
sudo polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.hibernate
sudo polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.reboot
sudo polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.shutdown
sudo polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.reboot-multiple-sessions
sudo polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.shutdown-multiple-sessions

which dosnt seem to work either.

So here i am begging all you linux masters or even those of you who have encountered this problem before for a little advice on either what to do or a least a little pointer to where i should go to find help.

Anyways, thanks for your time and any help is greatly appreciated,
D
Reply
#2
also tried adding my user to policy kit like so:

Code:
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->

<!DOCTYPE pkconfig PUBLIC "-//freedesktop//DTD PolicyKit Configuration 1.0//EN"
"http://hal.freedesktop.org/releases/PolicyKit/1.0/config.dtd">

<!-- See the manual page PolicyKit.conf(5) for file format -->

<config version="0.1">
    <match user="root">
        <return result="yes"/>
    </match>
    <match user="xbmc">
        <return result="yes"/>
    </match>
    <define_admin_auth group="admin"/>
</config>


No luck
Reply
#3
when you run xbmc, use "xbmc --standalone"

Edit: I think the script you used may do this....but you might try running xbmc with this just to test.

Also make sure that you have pm-utils installed
Code:
sudo apt-get install pm-utils
Reply
#4
follow this guide

http://forum.xbmc.org/showthread.php?p=4...post448088

and make sure u delete the space between freed and esktop if you paste whats in the post in the above link

Action=org.freedesktop.devicekit.power.*;org.freed esktop.consolekit.system.*


and go to last page on the thread to find out how to get wake up working
Reply
#5
draggy, moontan77, I thank you both for your replies.


draggy Wrote:when you run xbmc, use "xbmc --standalone"

Edit: I think the script you used may do this....but you might try running xbmc with this just to test.

Also make sure that you have pm-utils installed

I'm pretty sure that's what the script does, run in standalone. But i exited out to openbox and ran xbmc --standalone from a console, then tried to shut down again, but still just exits out to window manager. And pm-utils says it already the newest version.




moontan77 Wrote:follow this guide

http://forum.xbmc.org/showthread.php?p=4...post448088

and make sure u delete the space between freed and esktop if you paste whats in the post in the above link

Action=org.freedesktop.devicekit.power.*;org.freed esktop.consolekit.system.*


and go to last page on the thread to find out how to get wake up working


I tried what you suggested moontan, but still just gets me back to window manager.

heres the output for pkaction:
Code:
org.freedesktop.consolekit.system.restart
org.freedesktop.devicekit.power.qos.request-latency
org.freedesktop.consolekit.system.stop
org.freedesktop.devicekit.power.qos.set-minimum-latency
org.freedesktop.policykit.grant
org.freedesktop.policykit.revoke
org.freedesktop.policykit.modify-defaults
org.freedesktop.devicekit.power.qos.request-latency-persistent
org.freedesktop.consolekit.system.restart-multiple-users
org.freedesktop.devicekit.power.hibernate
org.freedesktop.devicekit.power.suspend
org.freedesktop.policykit.exec
org.freedesktop.consolekit.system.stop-multiple-users
org.freedesktop.policykit.read
org.freedesktop.devicekit.power.qos.cancel-request

and heres the output for:

xbmc@xbmc:~$ sudo cat /var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla
Code:
[Actions for xbmc user]
Identity=unix-user:xbmc
Action=org.freedesktop.devicekit.power.*;org.freedesktop.consolekit.system.*
ResultActive=yes
ResultAny=auth_admin
ResultInactive=yes

Once again thank you both for your replies,
D
Reply
#6
d_schrute Wrote:I used to have the orignal script running on the computer, the one from the first post. That worked like a charm, however i didn't have a window manager like openbox when i exited xbmc, so i couldn't switch over to boxee using irexec, it just went straight to the command prompt. Now that i have installed the latest script (post #176), i have a window manager, but cannot shut the computer down. I can't see what is the difference between the two script versions that would cause the problem.
Why you don't install xbmc again with the first script and than you can install a window manager like openbox or fluxbox manually?

But maybe you should post a debug log first.
Reply
#7
BurningSky Wrote:Why you don't install xbmc again with the first script and than you can install a window manager like openbox or fluxbox manually?


Do you happen to know how to have xbmc stop itself, then open a new openbox session. Would i just have a script that i'd call from the skin itself when i clicked exit, or would i just hard code something like: "sys.exec(openbox)" which would also replace the xbmc.quit() in the skin.

Thanks,
D
Reply
#8
i reinstalled the first version of this script as per burningsky's suggestion:
http://forum.xbmc.org/showpost.php?p=374815&postcount=1

but this time i added the end part of the updated script by biptn:
http://forum.xbmc.org/showpost.php?p=459...tcount=176

just to see what would happen. Like I thought i gives me the same problem. So it has to be these parts that are causing the problem, only i have no idea what they are doing, i know i'm pretty dumb.

what it looks like it does to me is:
create a file here: /etc/init/tty1.conf
Code:
# tty1 - getty
#
# This service maintains a getty on tty1 from the point the system is
# started until it is shut down again.

start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

respawn
exec /bin/login -f xbmc </dev/tty1 > /dev/tty1 2>&1

write this to .bash_profile
Code:
case "`tty`" in
/dev/tty1) clear && startx &>/dev/null;;
esac

add this to the .xinitrc file
Code:
exec openbox-session

and make a startup file for openbox: /usr/local/bin/xbmc-session

Code:
#!/bin/bash

trap "xbmc --standalone" SIGINT SIGHUP EXIT SIGTERM QUIT SIGSEGV
while true
do
#xbmc
#sleep 3
done

as a side note, i did comment out the xbmc and sleep 3 in the last file because i didn't want xbmc to automatically restart when it exited to openbox.

Those few files are the only things that are different between the two scripts and yet, they are not letting me shutdown. Like i mentioned eariler im pretty dumb when it comes to linux, so i'm not exactly sure what a couple of them do. But if you happen to have any ideas, i sure would appreciate the input.

once again thanks,
D
Reply
#9
What happen if you delete these 4 files again? Can you shutdown now?

What happen if you upgrade to SVN 27017? But if you install SVN you have to make these steps:
Code:
sudo echo '[Actions for xbmc user]' >> /var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla
sudo echo 'Identity=unix-user:xbmc' >> /var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla
sudo echo 'Action=org.freedesktop.devicekit.power.*;org.freedesktop.consolekit.system.*;org.freedesktop.devicekit.disks.*' >> /var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla
sudo echo 'ResultActive=yes' >> /var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla
sudo echo 'ResultAny=auth_admin' >> /var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla
sudo echo 'ResultInactive=yes' >> /var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla

sudo apt-get remove policykit-1 devicekit-power -y
sudo apt-get install devicekit-power -y
Reply
#10
BurningSky Wrote:What happen if you delete these 4 files again? Can you shutdown now?

Hey burningsky thanks for the reply.
If these four files are deleted, then you have the original script which does allow me to shutdown from xbmc. I know by experience if you delete just the /usr/local/bin/xbmc-session file it doesn't start openbox and thus xbmc doesn't start. What i'll try doing is deleting one at a time to see what that gets me in each instance. Or if that fails maybe try a combination of files. If all else fails i'll do what you suggest and upgrade to the newest SVN.

Since I have setup my htpc to run xbmc and boxee side-by-side under one partition, i have irexec running on openbox start up with a button mapped to startup each once i have exited to the openbox window manager. I'm thinking i'm also going to try using irexec to kill xbmc from my remote with a command like "sudo /sbin/shutdown -P now" or "sudo reboot" to reboot. This is probably a messy way of doing things, but if it works it'd be great.

Once again thanks alot for all the help,
D
Reply
#11
Until you get the problem fixed you can kill it with,ctrl,alt,b/space.
That would be a lot better than hitting the power button.
I enabled that in Ubuntu 9.10,byConfusedystem,pref,keyboard,keyboard preferences.
Hit layout options,you will see the option to: key sequence to kill the x server,
and enable that.
It will force a reboot,its not the best way of going about things,but better that a hard reset.
Why dont you try to install XBMC using the wiki guide?
I followed it to the letter and it went seamlessly.
Reply
#12
Ooops double post
Reply
#13
petemcfc Wrote:Until you get the problem fixed you can kill it with,ctrl,alt,b/space.
That would be a lot better than hitting the power button.
I enabled that in Ubuntu 9.10,byConfusedystem,pref,keyboard,keyboard preferences.
Hit layout options,you will see the option to: key sequence to kill the x server,
and enable that.
It will force a reboot,its not the best way of going about things,but better that a hard reset.


thanks petemcfc for the reply.
I dont have a desktop so i cant enable from there, and i have no clue how to due it via terminal. Plus i didn't wont to have a keyboard laying around to run xbmc, kinda wanted it to be a seemless thing that i could run with a single remote. I did figure out that mapping one of my buttons to irexec at startup giving the command "sudo shutdown -P now" does the trick. I just cant shut the computer down from xbmc itself, but im happy with it as is until i find a way to get it fixed.

petemcfc Wrote:Why dont you try to install XBMC using the wiki guide?
I followed it to the letter and it went seamlessly.

The script i used pretty much is the xbmcbuntu installation guide automated, does everything thing in that guide with out having to sit behind the keyboard and type in commands. So i figure it's just easier to use that than do a manual install.

Once again thanks for your suggestions,
D
Reply

Logout Mark Read Team Forum Stats Members Help
Can't get XBMC to shut down0