Gracefully shutting down slave process