Added graceful shutdown on SIGHUP