server with global wait for shutdown