Code to allow the server to run as a service in Mac, Windows and Linux