Moved code that stops services to rlib