Suport graceful shutdown on SIGTERM