Package: tor
Severity: wishlist

For users or relay operators that run multiple tor instances on a
single host a multi-instance systemd service file is handy.

I'm using a similar systemd unit file in my ansible-relayor configuration:
https://github.com/nusenu/ansible-relayor/blob/master/templates/debian_tor%40.service

Fedora also ships a similar systemd unit file since tor 0.2.6.8:
https://bugzilla.redhat.com/show_bug.cgi?id=1210837

When updating the tor package, all tor instances should be restarted.

here it is (I removed some of systemd's hardening feature from this
version due to #787758)

[Unit]
Description = Anonymizing overlay network for TCP
After = syslog.target network.target nss-lookup.target
[Service]
Type = simple
ExecStartPre = /usr/bin/tor -f /etc/tor/enabled/%i.torrc --verify-config
ExecStart = /usr/bin/tor -f /etc/tor/enabled/%i.torrc --runasdaemon 0
ExecReload = /bin/kill -HUP ${MAINPID}
KillSignal = SIGINT
TimeoutSec = 30
Restart = on-failure

LimitNOFILE = 32768
## Hardening
PrivateTmp = yes
PrivateDevices = yes
ProtectHome = yes
ProtectSystem = full


NoNewPrivileges = yes

CapabilityBoundingSet = CAP_SETUID CAP_SETGID CAP_NET_BIND_SERVICE
PermissionsStartOnly=yes

[Install]
WantedBy = multi-user.target

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to