summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2016-09-23 21:03:09 -0400
committerAnthony G. Basile <blueness@gentoo.org>2016-09-23 21:03:26 -0400
commit2fa0f1ef8f496d84505158682083789a82611df3 (patch)
tree9da201980abffb2545737f30ee1e2bfa367778e2 /net-misc/tor
parentpython-utils-r1.eclass: try C.UTF-8 and en_GB.UTF-8 in python_export_utf8_locale (diff)
downloadgentoo-2fa0f1ef8f496d84505158682083789a82611df3.tar.gz
gentoo-2fa0f1ef8f496d84505158682083789a82611df3.tar.bz2
gentoo-2fa0f1ef8f496d84505158682083789a82611df3.zip
net-misc/tor: update openrc init scripts, bug #593794
Package-Manager: portage-2.2.28
Diffstat (limited to 'net-misc/tor')
-rw-r--r--net-misc/tor/files/tor.initd-r842
-rw-r--r--net-misc/tor/tor-0.2.8.8-r1.ebuild (renamed from net-misc/tor/tor-0.2.8.8.ebuild)2
-rw-r--r--net-misc/tor/tor-0.2.9.3_alpha-r1.ebuild (renamed from net-misc/tor/tor-0.2.9.3_alpha.ebuild)2
3 files changed, 44 insertions, 2 deletions
diff --git a/net-misc/tor/files/tor.initd-r8 b/net-misc/tor/files/tor.initd-r8
new file mode 100644
index 000000000000..e1f6c599ca46
--- /dev/null
+++ b/net-misc/tor/files/tor.initd-r8
@@ -0,0 +1,42 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+command=/usr/bin/tor
+pidfile=/var/run/tor/tor.pid
+command_args="--hush --runasdaemon 1 --pidfile \"${pidfile}\""
+retry=${GRACEFUL_TIMEOUT:-60}
+
+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 /var/run/tor
+}
+
+stop() {
+ ebegin "Stopping Tor (waiting up to ${retry} seconds)"
+ start-stop-daemon -K -s INT -R ${retry} -P -p ${pidfile}
+ eend $?
+}
+
+reload() {
+ checkconfig || return 1
+ ebegin "Reloading Tor configuration"
+ start-stop-daemon -s HUP --pidfile ${pidfile}
+ eend $?
+}
diff --git a/net-misc/tor/tor-0.2.8.8.ebuild b/net-misc/tor/tor-0.2.8.8-r1.ebuild
index aeefa9fc3aa7..ee36db79dda2 100644
--- a/net-misc/tor/tor-0.2.8.8.ebuild
+++ b/net-misc/tor/tor-0.2.8.8-r1.ebuild
@@ -69,7 +69,7 @@ src_install() {
readme.gentoo_create_doc
newconfd "${FILESDIR}"/tor.confd tor
- newinitd "${FILESDIR}"/tor.initd-r7 tor
+ newinitd "${FILESDIR}"/tor.initd-r8 tor
systemd_dounit "${FILESDIR}/${PN}.service"
systemd_dotmpfilesd "${FILESDIR}/${PN}.conf"
diff --git a/net-misc/tor/tor-0.2.9.3_alpha.ebuild b/net-misc/tor/tor-0.2.9.3_alpha-r1.ebuild
index 0f889a958bc9..cd286ff23125 100644
--- a/net-misc/tor/tor-0.2.9.3_alpha.ebuild
+++ b/net-misc/tor/tor-0.2.9.3_alpha-r1.ebuild
@@ -67,7 +67,7 @@ src_install() {
readme.gentoo_create_doc
newconfd "${FILESDIR}"/tor.confd tor
- newinitd "${FILESDIR}"/tor.initd-r7 tor
+ newinitd "${FILESDIR}"/tor.initd-r8 tor
systemd_dounit "${FILESDIR}/${PN}.service"
systemd_dotmpfilesd "${FILESDIR}/${PN}.conf"