summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2019-12-08 12:03:52 -0500
committerAnthony G. Basile <blueness@gentoo.org>2019-12-08 12:03:52 -0500
commit3086f72684b219b707f99f9e4bcd85f08f20a977 (patch)
tree49fdd31777e9965c3d4bff187c14fea2fc09ab74 /net-vpn
parentnet-vpn/tor: depend on >=sys-libs/libseccomp-2.4.1, bug #700358 (diff)
downloadgentoo-3086f72684b219b707f99f9e4bcd85f08f20a977.tar.gz
gentoo-3086f72684b219b707f99f9e4bcd85f08f20a977.tar.bz2
gentoo-3086f72684b219b707f99f9e4bcd85f08f20a977.zip
net-vpn/tor: user /run instead of /var/run, bug #685296
Closes: https://bugs.gentoo.org/685296 Package-Manager: Portage-2.3.79, Repoman-2.3.16 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'net-vpn')
-rw-r--r--net-vpn/tor/files/tor-0.2.7.4-torrc.sample.patch2
-rw-r--r--net-vpn/tor/files/tor.initd-r937
-rw-r--r--net-vpn/tor/files/torrc-r27
-rw-r--r--net-vpn/tor/tor-0.4.1.6-r1.ebuild4
-rw-r--r--net-vpn/tor/tor-0.4.2.4_rc-r1.ebuild4
5 files changed, 49 insertions, 5 deletions
diff --git a/net-vpn/tor/files/tor-0.2.7.4-torrc.sample.patch b/net-vpn/tor/files/tor-0.2.7.4-torrc.sample.patch
index 92eb03bb18ea..5f9e258de031 100644
--- a/net-vpn/tor/files/tor-0.2.7.4-torrc.sample.patch
+++ b/net-vpn/tor/files/tor-0.2.7.4-torrc.sample.patch
@@ -8,7 +8,7 @@ diff -Nuar tor-0.2.7.4-rc.orig/src/config/torrc.sample.in tor-0.2.7.4-rc/src/con
+## Default username and group the server will run as
+User tor
+
-+PIDFile /var/run/tor/tor.pid
++PIDFile /run/tor/tor.pid
+
## Tor opens a SOCKS proxy on port 9050 by default -- even if you don't
## configure one below. Set "SOCKSPort 0" if you plan to run Tor only
diff --git a/net-vpn/tor/files/tor.initd-r9 b/net-vpn/tor/files/tor.initd-r9
new file mode 100644
index 000000000000..c1639c2af95a
--- /dev/null
+++ b/net-vpn/tor/files/tor.initd-r9
@@ -0,0 +1,37 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+command=/usr/bin/tor
+pidfile=/run/tor/tor.pid
+command_args="--hush --runasdaemon 1 --pidfile \"${pidfile}\""
+retry=${GRACEFUL_TIMEOUT:-60}
+stopsig=INT
+command_progress=yes
+
+extra_commands="checkconfig"
+extra_started_commands="reload"
+description="Anonymizing overlay network for TCP"
+description_checkconfig="Check for valid config file"
+description_reload="Reload the configuration"
+
+checkconfig() {
+ ${command} --verify-config --hush > /dev/null 2>&1
+ if [ $? -ne 0 ] ; then
+ eerror "Tor configuration (/etc/tor/torrc) is not valid."
+ eerror "Example is in /etc/tor/torrc.sample"
+ return 1
+ fi
+}
+
+start_pre() {
+ checkconfig || return 1
+ checkpath -d -m 0755 -o tor:tor /run/tor
+}
+
+reload() {
+ checkconfig || return 1
+ ebegin "Reloading Tor configuration"
+ start-stop-daemon -s HUP --pidfile ${pidfile}
+ eend $?
+}
diff --git a/net-vpn/tor/files/torrc-r2 b/net-vpn/tor/files/torrc-r2
new file mode 100644
index 000000000000..b308104c7031
--- /dev/null
+++ b/net-vpn/tor/files/torrc-r2
@@ -0,0 +1,7 @@
+#
+# Minimal torrc so tor will work out of the box
+#
+User tor
+PIDFile /run/tor/tor.pid
+Log notice syslog
+DataDirectory /var/lib/tor/data
diff --git a/net-vpn/tor/tor-0.4.1.6-r1.ebuild b/net-vpn/tor/tor-0.4.1.6-r1.ebuild
index 0e4ac6b73434..4bb1f0d376b1 100644
--- a/net-vpn/tor/tor-0.4.1.6-r1.ebuild
+++ b/net-vpn/tor/tor-0.4.1.6-r1.ebuild
@@ -75,7 +75,7 @@ src_install() {
readme.gentoo_create_doc
newconfd "${FILESDIR}"/tor.confd tor
- newinitd "${FILESDIR}"/tor.initd-r8 tor
+ newinitd "${FILESDIR}"/tor.initd-r9 tor
systemd_dounit contrib/dist/tor.service
keepdir /var/lib/tor
@@ -84,5 +84,5 @@ src_install() {
fowners tor:tor /var/lib/tor
insinto /etc/tor/
- newins "${FILESDIR}"/torrc-r1 torrc
+ newins "${FILESDIR}"/torrc-r2 torrc
}
diff --git a/net-vpn/tor/tor-0.4.2.4_rc-r1.ebuild b/net-vpn/tor/tor-0.4.2.4_rc-r1.ebuild
index e81cec3f97ec..ed9e10a6a652 100644
--- a/net-vpn/tor/tor-0.4.2.4_rc-r1.ebuild
+++ b/net-vpn/tor/tor-0.4.2.4_rc-r1.ebuild
@@ -77,7 +77,7 @@ src_install() {
readme.gentoo_create_doc
newconfd "${FILESDIR}"/tor.confd tor
- newinitd "${FILESDIR}"/tor.initd-r8 tor
+ newinitd "${FILESDIR}"/tor.initd-r9 tor
systemd_dounit contrib/dist/tor.service
keepdir /var/lib/tor
@@ -86,5 +86,5 @@ src_install() {
fowners tor:tor /var/lib/tor
insinto /etc/tor/
- newins "${FILESDIR}"/torrc-r1 torrc
+ newins "${FILESDIR}"/torrc-r2 torrc
}