Starting and stopping kodi from a script

What are the commands to start and stop kodi.

The aim is to restart kodi on resume so it’ll always start from the home screen when it turns on.

in older versions i would just enter killall xbmc in the resume section of the 99lirc-resume script. This worked OK killing and restarting xbmc on wake up no problems

Ive tried doing the same with kodi, ie killall kodi. which has the desired effect if the system is not playing any thing. But if a movie is playing and the machine is put to sleep before pressing stop, When it awakes again kodi will be at the home screen but you can hear the movie still playing.

Any ideas ?

Cheers