Fix K and S scripts and add stopping services script event

The K and S scripts were not working properly.  Also added stopping
services event scripts to perform operations before the services are
stopped.  This is ahead of the unmounting event.