You are not logged in.
Hi!
I have a htpc which will just start xbmc trough xinit.
And since consolekit was removed a few days ago, the shutdown, reboot entries in xbmc are gone.
I still booted with systemV init, but switched now to systemd, but shutdown/reboot is still missing.
I tried installing the polkit-use-wheel-group package from aur, but still nothing.
Does anyone know a way to get back the shutdown/reboot?
Offline
I'm seeing something similar, though I'm not sure it's the same problem. In my HTPC I see shutdown/reboot menu entries in XBMC, but they just close XBMC and immediately restart it without actually powering off/rebooting the pc. This happens since the removal of consolekit.
I've tried customizing the unit file following the wiki instructions. Changed the "Restart=always" line to "Restart=on-failure". Now when I issue a shutdown or reboot command through XBMC, XBMC closes and I go back to the login screen.
I've also tried enabling autologin into XFCE from GDM, and autostarting XBMC from the XFCE session, instead of launching XBMC with systemd. Similar behavior, only now when I try to shutdown/reboot from XBMC I just go back to the XFCE desktop (the session is not even closed).
When I login through ssh the user that owns the XBMC process in all cases can issue poweroff/reboot commands without issue, with or without sudo. I made sure to follow the instructions here:
https://wiki.archlinux.org/index.php/Al … o_Shutdown
and here:
http://wiki.xbmc.org/index.php?title=Ar … -less_sudo
I only have problems when trying to shutdown/reboot from inside XBMC. Either from an XFCE session or from ssh, using the same user, I can do it with no problem.
The arch wiki mentions that D-Bus and upower must be installed to enable shutdown-suspend-hibernate out of XBMC. I made sure they are installed, but I'm not sure if I have to configure something else there.
Until recently the wiki entry for XBMC had instructions to write a policykit rules file to enable power management; they've been removed, not sure why (they are no longer applicable maybe?). I've tried following them anyway but it still won't work.
I made sure that in the XBMC configuration the default shutdown action is set to actually shut down, not just close.
I'm sure it was working fine before the upgrade which removed consolekit.
Offline
Ive no idea how bad this is to do but with having the intention to reset my years old system I just tried to find a quick fix to this. I solved the exact same issue by installing both polkit-consolekit and consolekit-git using yaourt. Seems to have solved my issues for now.
Offline
please don't use any of those polkit-xy AUR packages, there are not needed. Same thing for crappy sudo NOPASSWD hacks. You just have to make sure that your session is properly registered by logind, how exactly are you starting X?
I just noticed the unit file on the XBMC wiki page: don't use it, it is crap and can't work because your session isn't set up properly. Either use a display manager or autologin into tty1 and startx from there.
Offline
Thx @65kid
I removed the xbcm system .service and followed:
https://wiki.archlinux.org/index.php/Au … al_console
and
https://wiki.archlinux.org/index.php/Start_X_at_Login
works perfect now.
Offline
wow, this crappy service file and an xbmc user with a whole bunch of obsolete groups (audio,video,storage) etc. is actually part of the package. This really shouldn't be used and obviously causes nothing but problems, I'm gonna write a bug report about this.
Offline
@65kid:
I don't use the unit file from the wiki. I use the unit file that comes with the xbmc package. I assume it's ok, I can paste it here if you like. It doesn't work (shutdown-reboot do not work), I've alsto tried customizing the user that owns the process and the "restart=on-failure" as I said in my post.
I also tried not using a unit file at all (systemctl disable xbmc) and instead starting a DM (systemctl enable gdm), enabling autologin into XFCE and from the XFCE session autostarting XBMC. I assume the session is correctly set up. Still shutdown-reboot does not work from XBMC; it does work from the XFCE desktop and from a ssh session, with the same user.
Any other useful info I can give about my setup?
Offline
regarding the unit file, read my post above.
please try the following:
1. make sure upower is installed.
2. make sure you use the polkit from the official repositories and don't have any useless polkit rules in /etc/polkit-1/...
3. create a new user and login with it to XBMC via GDM.
4. Make sure the shutdown option in XBMC is actually set to shutdown
This really should work. If it doesn't I'm going to have to test this myself.
Offline
@65kid:
Thanks for looking into it. Anyway, still no luck.
- upower is installed and up to date. I realized that the service was not enabled; I run a "systemctl enable upower" to enable it. However it seems to make no difference.
- polkit is installed from the official repos and up to date
- I've created a new user and set its .xinitrc to start xfce.
- I've logged in with the new user into xfce using gdm, and then launched xbmc. I made sure the default shutdown option was set to "shutdown".
After all this, XBMC still doesn't shut down or reboot. The menu options appear, but they just close XBMC itself, the session is not closed. I can see nothing of relevance in the logs. I've enabled the XBMC debugging log but there's nothing of interest there.
I also tried the method that worked for @rc9 (automatically login into a virtual console and autostarting X, instead of using a DM). Same result.
Anything else I can try?
Offline
mh, I just tried this myself. It turns out this indeed doesn't work for me either. As far as I understand, the shutdown/reboot functionality would be handled by ConsoleKit, so it would make sense that this doesn't work, since afaik XBMC would have to be patched to use systemd instead.
What however should work is suspending because this is handled by upower and I seriously have no idea why it doesn't work.
@rp9: what exactly is working for you? only suspending or shutting down as well?
Offline
got it. The XBMC code checks for ConsoleKit and if it doesn't exist, XBMC won't even try to use either ConsoleKit or UPower for its power management. The workaround is to simply install ConsoleKit and everything works as expected. So XBMC definitely has to be patched for systemd.
It works for rp9 because he still has ConsoleKit installed.
Offline
65kid - Good bit of detective work. Have you checked or opened a bug against upstream?
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
65kid - Good bit of detective work. Have you checked or opened a bug against upstream?
I opened a thread on the XBMC forums:
http://forum.xbmc.org/showthread.php?tid=144419
Offline
@65kid: shutdown, reboot, suspend.. everything
yes I still have the consolekit package installed and guess I will keep it until there is a patch for xbmc
Offline
I ran into exactly the same issue today... instead of going throught the hassle of installing consolekit on my system, I went for more a drastic solution.
If XBMC is running, then not running anymore (because I clicked "shutdown" and it exited) I just "poweroff" my system. I do that with a little bit of bash run by root (in a cron, but it could work with a systemd service):
#!/bin/bash
while :;do
if pgrep xbmc;then
#XBMC is running
while :; do
if ! pgrep xbmc;then
#XBMC was running, but is not anymore
/sbin/poweroff
fi
sleep 1s
done
fi
sleep 1s
done
This is very ugly... but it will do for the time being!
Offline
@65kid: Good find, thanks. Same as @rp9, I guess I will reinstall consolekit from the pacman cache and keep it until xbmc is patched.
I don't have high hopes that this will be patched quickly. It seems to me xbmc development is mainly focused in ubuntu, and I don't expect this to be a high priority. We will see.
Offline
I opened a thread on the XBMC forums:
http://forum.xbmc.org/showthread.php?tid=144419
You'll very likely need to open a ticket on the bug tracker for a dev to see and know about this if it isn't there already.
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
You'll very likely need to open a ticket on the bug tracker for a dev to see and know about this if it isn't there already.
Offline
same problem here, updated yesterday and now I'm not able to shutdown XBMC properly. Only the suspend and hibernate options are available. Hoping for a patch soon.
Offline
After an upgrade, I'm experiencing this bug again. It seems the workaround of keeping consolekit installed no longer works for me.
Offline
I think we can edit DialogButtonMenu.xml to run custom comands, eg. systemctl poweroff.
Offline
A fix for systemd was merged into the main git branch 2 days ago. I am trying a build now to see if it works as advertised. It is supposed to determine whether systemd or consolekit is being used and act accordingly, as far as I can tell anyways. Hope it works.
here's the commit:
https://github.com/xbmc/xbmc/commit/58d … 59de283732
I will try to update once my build is complete and installed. :-)
Last edited by ould (2012-12-02 16:47:09)
Offline
It works! Even better, it can tell which options are supported, eg. on Raspberry Pi there is no suspend option.
Offline
It works! Even better, it can tell which options are supported, eg. on Raspberry Pi there is no suspend option.
Did you do anything special to make it work. It is still not working for me. How are you starting xbmc? Maybe that has something to do with it. I am using this service file:
https://projects.archlinux.org/svntogit … kages/xbmc
Thanks,
Kevin
Offline
Offline