[tor-commits] [tor/master] Put tor.service in the right place, and autoconfify it

nickm at torproject.org nickm at torproject.org
Tue Apr 29 17:18:05 UTC 2014


commit cae638805385ae0ef717eb21e1592aeb1d85182c
Author: Nick Mathewson <nickm at torproject.org>
Date:   Tue Apr 29 12:15:40 2014 -0400

    Put tor.service in the right place, and autoconfify it
    
    This closes 8368.
---
 changes/ticket8368          |    5 +++++
 configure.ac                |    1 +
 contrib/dist/tor.service.in |   21 +++++++++++++++++++++
 contrib/include.am          |    1 +
 contrib/tor.service         |   21 ---------------------
 5 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/changes/ticket8368 b/changes/ticket8368
new file mode 100644
index 0000000..206a766
--- /dev/null
+++ b/changes/ticket8368
@@ -0,0 +1,5 @@
+  o Distribution:
+    - Include a tor.service file in contrib.dist for use with
+      systemd. Some distributions will be able to use this file unmodified;
+      others will need to tweak it, or write their own. Patch from
+      Jamie Nguyen; resolves ticket 8368.
diff --git a/configure.ac b/configure.ac
index ca7c9c0..c0c8187 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1561,6 +1561,7 @@ AC_CONFIG_FILES([
         contrib/operator-tools/tor.logrotate
         contrib/dist/tor.sh
         contrib/dist/torctl
+        contrib/dist/tor.service
         src/config/torrc.sample
 ])
 
diff --git a/contrib/dist/tor.service.in b/contrib/dist/tor.service.in
new file mode 100644
index 0000000..5d76702
--- /dev/null
+++ b/contrib/dist/tor.service.in
@@ -0,0 +1,21 @@
+[Unit]
+Description = Anonymizing overlay network for TCP
+After = syslog.target network.target nss-lookup.target
+
+[Service]
+Type = simple
+ExecStart = @BINDIR@/tor -f @CONFDIR@/torrc
+ExecReload = /bin/kill -HUP ${MAINPID}
+KillSignal = SIGINT
+TimeoutSec = 30
+Restart = on-failure
+LimitNOFILE = 32768
+
+# Hardening
+PrivateTmp = yes
+DeviceAllow = /dev/null rw
+DeviceAllow = /dev/urandom r
+InaccessibleDirectories = /home
+
+[Install]
+WantedBy = multi-user.target
diff --git a/contrib/include.am b/contrib/include.am
index 0120798..ede9806 100644
--- a/contrib/include.am
+++ b/contrib/include.am
@@ -5,6 +5,7 @@ EXTRA_DIST+= \
 	contrib/dist/suse/tor.sh.in			\
 	contrib/dist/tor.sh				\
 	contrib/dist/torctl				\
+	contrib/dist/tor.service.in			\
 	contrib/operator-tools/linux-tor-prio.sh	\
 	contrib/operator-tools/tor-exit-notice.html	\
 	contrib/or-tools/exitlist			\
diff --git a/contrib/tor.service b/contrib/tor.service
deleted file mode 100644
index 2780aaa..0000000
--- a/contrib/tor.service
+++ /dev/null
@@ -1,21 +0,0 @@
-[Unit]
-Description = Anonymizing overlay network for TCP
-After = syslog.target network.target nss-lookup.target
-
-[Service]
-Type = simple
-ExecStart = /usr/bin/tor -f /etc/tor/torrc
-ExecReload = /bin/kill -HUP ${MAINPID}
-KillSignal = SIGINT
-TimeoutSec = 30
-Restart = on-failure
-LimitNOFILE = 32768
-
-# Hardening
-PrivateTmp = yes
-DeviceAllow = /dev/null rw
-DeviceAllow = /dev/urandom r
-InaccessibleDirectories = /home
-
-[Install]
-WantedBy = multi-user.target



More information about the tor-commits mailing list