add first version of ServiceMgmt script
fix return code when an error occurs