Added graceful shutdown on SIGHUP

Please use parenthesis instead of backslash continuations here, and try to not overrun 79 chars.