diff options
author | Tomasz Torcz <tomek@pipebreaker.pl> | 2015-01-09 22:44:00 +0100 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-01-11 11:14:14 -0500 |
commit | 2aa2d0a1c559bcc2f2198ab7df37ab0a33605904 (patch) | |
tree | 22d3fa3c762b1bd58709e8076dc41c9ae96c6e89 /src/or/main.c | |
parent | b17918726d2ec221556d707f06bb92cfa3830183 (diff) | |
download | tor-2aa2d0a1c559bcc2f2198ab7df37ab0a33605904.tar.gz tor-2aa2d0a1c559bcc2f2198ab7df37ab0a33605904.zip |
send more details about daemon status to supervisor
If running under systemd, send back information when reloading
configuration and gracefully shutting down. This gives administator
more information about current Tor daemon state.
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/or/main.c b/src/or/main.c index 9e5a916b16..1b439041b9 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -2169,6 +2169,9 @@ process_signal(uintptr_t sig) tor_cleanup(); exit(0); } +#ifdef HAVE_SYSTEMD + sd_notify(0, "STOPPING=1"); +#endif hibernate_begin_shutdown(); break; #ifdef SIGPIPE @@ -2188,11 +2191,17 @@ process_signal(uintptr_t sig) control_event_signal(sig); break; case SIGHUP: +#ifdef HAVE_SYSTEMD + sd_notify(0, "RELOADING=1"); +#endif if (do_hup() < 0) { log_warn(LD_CONFIG,"Restart failed (config error?). Exiting."); tor_cleanup(); exit(1); } +#ifdef HAVE_SYSTEMD + sd_notify(0, "READY=1"); +#endif control_event_signal(sig); break; #ifdef SIGCHLD |