It handles graceful termination by listening to signals which will be particularly useful for commands where the sole purpose is to run an http server.