Bug 1210837 - add multi-instance systemd service file for tor
Summary: add multi-instance systemd service file for tor
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: tor
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nobody's working on this, feel free to take it
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-10 16:38 UTC by nusenu
Modified: 2020-11-05 09:44 UTC (History)
3 users (show)

Fixed In Version: tor-0.2.6.8-1.fc21
Clone Of:
Environment:
Last Closed: 2015-06-13 19:34:59 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description nusenu 2015-04-10 16:38:06 UTC
Hi,

there are use cases where one might want to run more than one tor instance.

Systemd has elegant multi-instance support:
http://0pointer.de/blog/projects/instances.html


/lib/systemd/system/tor@.service:
---------
[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


[Install]
WantedBy = multi-user.target
---------

systemctl tor start
will use the config file: /etc/tor/enabled/foobar.torrc

Works fine with the current SELinux policy (tor_t) as well when setting the appropriate context (tor_unit_file_t).

example: 
I make use of this service file in an ansible role:
https://github.com/nusenu/ansible-relayor

It is the responsibility of the user to choose appropriate settings (separate datadir, logfiles, ...).

Comment 1 Jamie Nguyen 2015-04-10 17:17:59 UTC
THanks for the bug report! Definitely sounds like a good idea. I'll take a look at this soon. There are some security updates that need to be pushed to stable repos first.

Comment 2 Fedora Update System 2015-05-21 16:54:49 UTC
tor-0.2.6.8-1.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/tor-0.2.6.8-1.fc22

Comment 3 Fedora Update System 2015-05-21 16:55:10 UTC
tor-0.2.6.8-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/tor-0.2.6.8-1.fc21

Comment 4 Fedora Update System 2015-05-21 16:56:23 UTC
tor-0.2.6.8-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/tor-0.2.6.8-1.el7

Comment 5 Fedora Update System 2015-05-22 02:31:00 UTC
Package tor-0.2.6.8-1.fc22:
* should fix your issue,
* was pushed to the Fedora 22 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing tor-0.2.6.8-1.fc22'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-8680/tor-0.2.6.8-1.fc22
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2015-06-13 19:34:59 UTC
tor-0.2.6.8-1.el7 has been pushed to the Fedora EPEL 7 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2015-06-14 17:29:54 UTC
tor-0.2.6.8-1.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2015-06-14 17:31:27 UTC
tor-0.2.6.8-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.