gracefull shutdown of server on sigint or sigterm