summaryrefslogtreecommitdiff
path: root/contrib/dist
diff options
context:
space:
mode:
authorTomasz Torcz <tomek@pipebreaker.pl>2015-01-09 22:17:50 +0100
committerNick Mathewson <nickm@torproject.org>2015-01-11 11:14:08 -0500
commitb17918726d2ec221556d707f06bb92cfa3830183 (patch)
treefe5ac3e0e61612c91ef0f2d2514c86b489dadaba /contrib/dist
parent180ecd6a2b3ee9fe10fed760d30ac9fb72b03346 (diff)
downloadtor-b17918726d2ec221556d707f06bb92cfa3830183.tar.gz
tor-b17918726d2ec221556d707f06bb92cfa3830183.zip
send PID of the main daemon to supervisor
If running under systemd, notify the supervisor about current PID of Tor daemon. This makes systemd unit simpler and more robust: it will do the right thing regardless of RunAsDaemon settings.
Diffstat (limited to 'contrib/dist')
-rw-r--r--contrib/dist/tor.service.in7
1 files changed, 3 insertions, 4 deletions
diff --git a/contrib/dist/tor.service.in b/contrib/dist/tor.service.in
index 57409a7b0a..607615afa2 100644
--- a/contrib/dist/tor.service.in
+++ b/contrib/dist/tor.service.in
@@ -3,11 +3,10 @@ Description = Anonymizing overlay network for TCP
After = syslog.target network.target nss-lookup.target
[Service]
-Type = simple
+Type = notify
+NotifyAccess = all
ExecStartPre = @BINDIR@/tor -f @CONFDIR@/torrc --verify-config
-# A torrc that has "RunAsDaemon 1" won't work with the "simple" service type;
-# let's explicitly override it.
-ExecStart = @BINDIR@/tor -f @CONFDIR@/torrc --RunAsDaemon 0
+ExecStart = @BINDIR@/tor -f @CONFDIR@/torrc
ExecReload = /bin/kill -HUP ${MAINPID}
KillSignal = SIGINT
TimeoutSec = 30