summaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorMichael Scherer <misc@zarb.org>2014-02-21 00:24:25 +0100
committerNick Mathewson <nickm@torproject.org>2014-12-23 11:06:01 -0500
commitaabaed6f497335b81f18347e626ff3d9ae7799d5 (patch)
treeb40b88014e13ca6a67b8bf7383c4eb0da21b4fb3 /src/or/main.c
parentc6ac752353e6b03b2cbf2822d8fe2c60dfb03746 (diff)
downloadtor-aabaed6f497335b81f18347e626ff3d9ae7799d5.tar.gz
tor-aabaed6f497335b81f18347e626ff3d9ae7799d5.zip
add support for systemd notification protocol
This permit for now to signal readiness in a cleaner way to systemd.
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 160bfa00e0..9fa62f89ef 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -75,6 +75,10 @@
#include <event2/bufferevent.h>
#endif
+#ifdef HAVE_SYSTEMD
+#include <systemd/sd-daemon.h>
+#endif
+
void evdns_shutdown(int);
/********* PROTOTYPES **********/
@@ -2043,6 +2047,11 @@ do_main_loop(void)
}
#endif
+#ifdef HAVE_SYSTEMD
+ log_notice(LD_GENERAL, "Signaling readyness to systemd");
+ sd_notify(0, "READY=1");
+#endif
+
for (;;) {
if (nt_service_is_stopping())
return 0;