tor.service.in 831 B

1234567891011121314151617181920212223242526272829
  1. [Unit]
  2. Description = Anonymizing overlay network for TCP
  3. After = syslog.target network.target nss-lookup.target
  4. [Service]
  5. Type = simple
  6. ExecStartPre = @BINDIR@/tor -f @CONFDIR@/torrc --verify-config
  7. # A torrc that has "RunAsDaemon 1" won't work with the "simple" service type;
  8. # let's explicitly override it.
  9. ExecStart = @BINDIR@/tor -f @CONFDIR@/torrc --RunAsDaemon 0
  10. ExecReload = /bin/kill -HUP ${MAINPID}
  11. KillSignal = SIGINT
  12. TimeoutSec = 30
  13. Restart = on-failure
  14. LimitNOFILE = 32768
  15. # Hardening
  16. PrivateTmp = yes
  17. DeviceAllow = /dev/null rw
  18. DeviceAllow = /dev/urandom r
  19. InaccessibleDirectories = /home
  20. ReadOnlyDirectories = /
  21. ReadWriteDirectories = @LOCALSTATEDIR@/lib/tor
  22. ReadWriteDirectories = @LOCALSTATEDIR@/log/tor
  23. ReadWriteDirectories = @LOCALSTATEDIR@/run/tor
  24. NoNewPrivileges = yes
  25. [Install]
  26. WantedBy = multi-user.target