# xbmc power off / restart via menu?



## moosejaw (Jun 28, 2013)

Has anyone succeeded in getting their system to shutdown/reboot via the xbmc menu?

I am running 9.1/i386 with xbmc 12.0_2. I have my system set up as an HTPC, with xbmc autostarted via slim.  When I first set this up (yesterday), I could successfully get the system to power off or reboot via xbmc's menu items for same.  Now, for some reason, I can't.

My xbmc user is in the wheel and operator groups.  I've tried starting slim via /etc/ttys and via rc.  I've tried using `ck-launch-session` in .xinitrc.  I've tried enabling all of the stop and restart commands in polkit as described in this thread: https://forums.freebsd.org/showthread.php?t=33192&highlight=polkit.  hald and dbus are both running.

No matter what I do now, upon selecting the "power off system" or "reboot" commands in the xbmc menu, X stops and I get the slim login screen.  If I kill slim and log in via a virtual console, I just get dropped back to the console upon using "power off system" or "reboot" in xbmc.

What is especially curious is that this was working initially, but now it's very consistently impossible for me to shutdown or reboot the machine via the xbmc menu.

Any thoughts/advice would be greatly appreciated!


----------



## moosejaw (Jun 29, 2013)

An update: I discovered the "power off" command in XBMC's iOS remote control app, and that seems to be working.  Occasionally it drops me back to the slim login screen, but most of the time it successfully powers down the machine.  Unsuccessful power-downs tend to occur when the machine has only been powered up for a few minutes; maybe some other process is interfering for the first few minutes after boot (e.g. some networking process that eventually times out)?  Issuing `/sbin/shutdown -p now` from the command line works no matter what, even when logged in just as my xbmc user in the operator group, and even immediately after booting.  Not sure how XBMC's shutdown function differs from the above (I have `/sbin/shutdown -p now` set as the shutdown function in /usr/local/etc/slim.conf).

Anyway, I thought I would mention the XBMC remote control app (there is an Android version as well) for others who might be having similar problems.


----------



## Fneufneu (Jan 4, 2014)

*J*ust follow the XBMC wiki: http://wiki.xbmc.org/index.php?title=HO ... r_to_sleep _It_ works the same way on FreeBSD, you will just find the polkit configuration files in /usr/local/etc/polkit-1/ and not in /var/lib/....


----------

