mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
add support for systemd notification protocol
This permit for now to signal readiness in a cleaner way to systemd.
This commit is contained in:
committed by
Nick Mathewson
parent
c6ac752353
commit
aabaed6f49
+2
-2
@@ -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 = \
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user