[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] send more details about daemon status to supervisor
commit 2aa2d0a1c559bcc2f2198ab7df37ab0a33605904
Author: Tomasz Torcz <tomek@xxxxxxxxxxxxxx>
Date: Fri Jan 9 22:44:00 2015 +0100
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.
---
src/or/main.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/or/main.c b/src/or/main.c
index 9e5a916..1b43904 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
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits