diff options
author | intrigeri <intrigeri@boum.org> | 2014-07-29 12:23:04 +0000 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2014-07-30 16:54:07 +0000 |
commit | 8b470ee4b54582b599debf5ab5b996eb06525093 (patch) | |
tree | 966a89738f497292951ed0182e80e73a1c3dc0b7 /contrib/dist | |
parent | 5c200d9be28ac9e53caac333ddd334539524d9e1 (diff) | |
download | tor-8b470ee4b54582b599debf5ab5b996eb06525093.tar.gz tor-8b470ee4b54582b599debf5ab5b996eb06525093.zip |
Explicitly disable RunAsDaemon in the systemd unit file (#12731).
Our current systemd unit uses "Type = simple", so systemd does not expect tor to
fork. If the user has "RunAsDaemon 1" in their torrc, then things won't work as
expected. This is e.g. the case on Debian (and derivatives), since there we pass
"--defaults-torrc /usr/share/tor/tor-service-defaults-torrc" (that contains
"RunAsDaemon 1") by default.
The only solution I could find is to explicitly pass "--RunAsDaemon 0" when
starting tor from the systemd unit file, which this commit does.
Diffstat (limited to 'contrib/dist')
-rw-r--r-- | contrib/dist/tor.service.in | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/dist/tor.service.in b/contrib/dist/tor.service.in index 5d7670281b..1d52f622fa 100644 --- a/contrib/dist/tor.service.in +++ b/contrib/dist/tor.service.in @@ -4,7 +4,9 @@ After = syslog.target network.target nss-lookup.target [Service] Type = simple -ExecStart = @BINDIR@/tor -f @CONFDIR@/torrc +# 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 ExecReload = /bin/kill -HUP ${MAINPID} KillSignal = SIGINT TimeoutSec = 30 |