summaryrefslogtreecommitdiffstats
path: root/SOURCES/onionbalance.service
blob: 476ebf085a37495f7327c5de6a52fdad22efb424 (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
# OnionBalance systemd target

[Unit]
Description=OnionBalance - Tor Onion Service load balancer
Documentation=https://github.com/DonnchaC/onionbalance
After=network.target tor.service tor@.service tor-master.service
Wants=network-online.target
ConditionPathExists=/etc/onionbalance/config.yaml

[Service]
Type=simple
PIDFile=/run/onionbalance.pid
Environment="ONIONBALANCE_LOG_LOCATION=/var/log/onionbalance/log"
ExecStart=/usr/bin/onionbalance -c /etc/onionbalance/config.yaml
ExecReload=/usr/bin/onionbalance reload
TimeoutStopSec=5
KillMode=mixed

User=onionbalance
PermissionsStartOnly=true
Restart=on-abnormal
RestartSec=2s
LimitNOFILE=65536

# Hardening
CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_CHOWN CAP_FOWNER
NoNewPrivileges=yes
PrivateDevices=yes
PrivateTmp=yes
ProtectHome=yes
ProtectSystem=full
RuntimeDirectory=onionbalance
ReadOnlyDirectories=/
ReadWriteDirectories=-/proc
ReadWriteDirectories=-/var/lib/onionbalance
ReadWriteDirectories=-/var/log/onionbalance
ReadWriteDirectories=-/run

[Install]
WantedBy=multi-user.target