Kodi Community Forum
[XBMCbuntu] start and stop from the command line - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52)
+---- Thread: [XBMCbuntu] start and stop from the command line (/showthread.php?tid=178445)



[XBMCbuntu] start and stop from the command line - Bagger - 2013-11-20

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.


RE: [XBMCbuntu] start and stop from the command line - un1versal - 2013-11-20

stop service lightdm


RE: [XBMCbuntu] start and stop from the command line - Bagger - 2013-11-20

Thanks for the quick reply.
I'll give that a go tomorrow, bed time now Smile


RE: [XBMCbuntu] start and stop from the command line - nickr - 2013-11-20

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



RE: [XBMCbuntu] start and stop from the command line - Bagger - 2013-11-21

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


RE: [XBMCbuntu] start and stop from the command line - teeedubb - 2013-11-21

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


RE: [XBMCbuntu] start and stop from the command line - Bagger - 2013-11-21

Thanks I shall look into that tomorrow.


RE: [XBMCbuntu] start and stop from the command line - Bagger - 2013-11-21

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



RE: [XBMCbuntu] start and stop from the command line - Kib - 2013-11-22

Code:
service lightdm restart
works for me.

edit: Ah, thats what you said Smile