diff options
author | Michael Scherer <misc@zarb.org> | 2014-02-21 00:24:25 +0100 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-12-23 11:06:01 -0500 |
commit | aabaed6f497335b81f18347e626ff3d9ae7799d5 (patch) | |
tree | b40b88014e13ca6a67b8bf7383c4eb0da21b4fb3 /src/or | |
parent | c6ac752353e6b03b2cbf2822d8fe2c60dfb03746 (diff) | |
download | tor-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')
-rw-r--r-- | src/or/include.am | 4 | ||||
-rw-r--r-- | src/or/main.c | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/or/include.am b/src/or/include.am index 643f7ce001..fb1581c463 100644 --- a/src/or/include.am +++ b/src/or/include.am @@ -111,7 +111,7 @@ src_or_tor_LDADD = src/or/libtor.a src/common/libor.a \ src/common/libor-crypto.a $(LIBDONNA) \ src/common/libor-event.a \ @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \ - @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ + @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ @TOR_SYSTEMD_LIBS@ if COVERAGE_ENABLED src_or_tor_cov_SOURCES = src/or/tor_main.c @@ -122,7 +122,7 @@ src_or_tor_cov_LDADD = src/or/libtor-testing.a src/common/libor-testing.a \ src/common/libor-crypto-testing.a $(LIBDONNA) \ src/common/libor-event-testing.a \ @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \ - @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ + @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ @TOR_SYSTEMD_LIBS@ endif ORHEADERS = \ 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; |