summaryrefslogtreecommitdiff
path: root/net-vpn/tor/files/tor.service-r1
blob: 7abc07574e364b0c64da9c36a7751179328811d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# tor.service -- this systemd configuration file for Tor sets up a
# relatively conservative, hardened Tor service.  You may need to
# edit it if you are making changes to your Tor configuration that it
# does not allow.  Package maintainers: this should be a starting point
# for your tor.service; it is not the last point.

[Unit]
Description=Anonymizing overlay network for TCP
After=syslog.target network.target nss-lookup.target

[Service]
User=tor
Type=notify
NotifyAccess=all
ExecStartPre=/usr/bin/tor --DataDirectory "$STATE_DIRECTORY" --CacheDirectory "$CACHE_DIRECTORY" -f /etc/tor/torrc --verify-config
ExecStart=/usr/bin/tor --DataDirectory "$STATE_DIRECTORY" --CacheDirectory "$CACHE_DIRECTORY"  -f /etc/tor/torrc
ExecReload=/bin/kill -HUP ${MAINPID}
KillSignal=SIGINT
TimeoutSec=60
Restart=on-failure
WatchdogSec=1m
LimitNOFILE=32768

# Hardening
Group=tor
CacheDirectory=tor
CacheDirectoryMode=0770
StateDirectory=tor
StateDirectoryMode=0770
LogsDirectory=tor
LogsDirectoryMode=0770
RuntimeDirectory=tor
RuntimeDirectoryMode=0770
PrivateTmp=yes
PrivateDevices=yes
ProtectHome=yes
ProtectSystem=full
ReadOnlyDirectories=/
NoNewPrivileges=yes
CapabilityBoundingSet=CAP_SETUID CAP_SETGID CAP_NET_BIND_SERVICE

[Install]
WantedBy=multi-user.target