Refactored stoping and launching services and reading the pid from a file,