If we're not in debug mode, wait for RMI and run cleanup on start