[XBMCbuntu] start and stop from the command line
#1
I've just installed XBMCbuntu 12.2
What is the command to use to stop/start xbmc from either a script or SSH window

My aim is to stop xbmc on suspend and re-start it on resume so that xbmc will always resume from the home window rather than where it was left.
I managed to do this with dharma xbmclive install, but cant seem to work out the command on this newer version.

Any help is much appreciated.
Reply
#2
stop service lightdm
Reply
#3
Thanks for the quick reply.
I'll give that a go tomorrow, bed time now Smile
Reply
#4
lightdm is the display manager. In xbmcbuntu it starts X and then starts XBMC - so stopping lightdm stops X and that certainly stops xbmc.

You may need to start lightdm again on resume using Uni's approach. That is simply
Code:
service start lightdm
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#5
Ive managed to get this to work ....... with the following script in /etc/pm/sleep.d/
It originally was a script to stop and start lirc found here

Code:
case "${1}" in
        suspend|hibernate)

               #/etc/init.d/lightdm stop
               service lightdm stop
                ;;
        resume|thaw)

               service lightdm start
              #/etc/init.d/lightdm start
                ;;
esac

It seems to work fine. It will suspend the machine and when resumes goes straight to the home menu just as I want.
But.... its not very reliable, every 3 times ish can be 4 or can be twice. It doesnt restart on resume.

The OS is still running in the back ground as I can SSH into it .

Any idea's to what I'm doing wrong would be even more appreciated.......so close Smile
Reply
#6
Instead of restarting xbmc, use a resume hook to send a json-rpc command to xbmc to return to the home screen. Instead of json-rpc you could also use the xbmc-send event client. I can post a example when I get home if you like.

Edit: here you go

http://forum.xbmc.org/showthread.php?tid=159467
Reply
#7
Thanks I shall look into that tomorrow.
Reply
#8
Sorted.
Now when I resume it takes me straight back to the home screen.
teeedubb gave me the idea, rather that stopping the service and then starting it again. I just used the restart command on resume.

for anyone intersested

Create a script at /etc/pm/sleep.d/90_re-lightdm
Code:
sudo nano  /etc/pm/sleep.d/90_re-lightdm


Code:
case "${1}" in
        suspend|hibernate)


                ;;
        resume|thaw)

               service lightdm restart

                ;;
esac


Make sure the script is executable.
Code:
sudo chmod 755 /etc/pm/sleep.d/90_re-lightdm
Reply
#9
Code:
service lightdm restart
works for me.

edit: Ah, thats what you said Smile
Reply

Logout Mark Read Team Forum Stats Members Help
[XBMCbuntu] start and stop from the command line0