1 |
fauli 09/06/03 08:09:04 |
2 |
|
3 |
Modified: torrc.sample-0.1.2.6.patch |
4 |
Added: tor.initd-r5 |
5 |
Removed: tor.initd-r4 |
6 |
Log: |
7 |
Really respect limits from /etc/limits.d/ by some tweaks: moving user context switch from torrc to init script, including verification of config file in the latter; fixes bug 268396 by W. Elschner <gentoobugzilla_reply AT elschner DOT net> |
8 |
(Portage version: 2.1.6.11/cvs/Linux i686, RepoMan options: --force) |
9 |
|
10 |
Revision Changes Path |
11 |
1.2 net-misc/tor/files/torrc.sample-0.1.2.6.patch |
12 |
|
13 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/tor/files/torrc.sample-0.1.2.6.patch?rev=1.2&view=markup |
14 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/tor/files/torrc.sample-0.1.2.6.patch?rev=1.2&content-type=text/plain |
15 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/tor/files/torrc.sample-0.1.2.6.patch?r1=1.1&r2=1.2 |
16 |
|
17 |
Index: torrc.sample-0.1.2.6.patch |
18 |
=================================================================== |
19 |
RCS file: /var/cvsroot/gentoo-x86/net-misc/tor/files/torrc.sample-0.1.2.6.patch,v |
20 |
retrieving revision 1.1 |
21 |
retrieving revision 1.2 |
22 |
diff -u -r1.1 -r1.2 |
23 |
--- torrc.sample-0.1.2.6.patch 27 Jan 2007 23:58:36 -0000 1.1 |
24 |
+++ torrc.sample-0.1.2.6.patch 3 Jun 2009 08:09:04 -0000 1.2 |
25 |
@@ -1,13 +1,9 @@ |
26 |
--- src/config/torrc.sample.in.orig 2007-01-27 23:41:23.000000000 +0000 |
27 |
+++ src/config/torrc.sample.in 2007-01-27 23:43:47.000000000 +0000 |
28 |
-@@ -18,6 +18,11 @@ |
29 |
+@@ -18,6 +18,7 @@ |
30 |
## With the default Mac OS X installer, Tor will look in ~/.tor/torrc or |
31 |
## /Library/Tor/torrc |
32 |
|
33 |
-+## Default username and group the server will run as |
34 |
-+User tor |
35 |
-+Group tor |
36 |
-+ |
37 |
+PIDFile /var/run/tor/tor.pid |
38 |
|
39 |
## Replace this with "SocksPort 0" if you plan to run Tor only as a |
40 |
|
41 |
|
42 |
|
43 |
1.1 net-misc/tor/files/tor.initd-r5 |
44 |
|
45 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/tor/files/tor.initd-r5?rev=1.1&view=markup |
46 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/tor/files/tor.initd-r5?rev=1.1&content-type=text/plain |
47 |
|
48 |
Index: tor.initd-r5 |
49 |
=================================================================== |
50 |
#!/sbin/runscript |
51 |
# Copyright 1999-2005 Gentoo Foundation |
52 |
# Distributed under the terms of the GNU General Public License v2 |
53 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/tor/files/tor.initd-r5,v 1.1 2009/06/03 08:09:04 fauli Exp $ |
54 |
|
55 |
opts="${opts} checkconfig reload" |
56 |
PIDFILE=/var/run/tor/tor.pid |
57 |
CONFFILE=/etc/tor/torrc |
58 |
|
59 |
depend() { |
60 |
need net |
61 |
} |
62 |
|
63 |
checkconfig() { |
64 |
# first check that it exists |
65 |
if [ ! -f ${CONFFILE} ] ; then |
66 |
eerror "You need to setup ${CONFFILE} first" |
67 |
eerror "Example is in ${CONFFILE}.sample" |
68 |
return 1 |
69 |
fi |
70 |
|
71 |
# now verify whether the configuration is valid |
72 |
/usr/bin/tor --verify-config --User tor -f ${CONFFILE} > /dev/null 2>&1 |
73 |
if [ $? -eq 0 ] ; then |
74 |
einfo "Tor configuration (${CONFFILE}) is valid." |
75 |
return 0 |
76 |
else |
77 |
eerror "Tor configuration (${CONFFILE}) not valid." |
78 |
/usr/bin/tor --verify-config --User tor -f ${CONFFILE} |
79 |
return 1 |
80 |
fi |
81 |
} |
82 |
|
83 |
start() { |
84 |
checkconfig || return 1 |
85 |
ebegin "Starting Tor" |
86 |
HOME=/var/lib/tor |
87 |
start-stop-daemon --start --user tor:tor --pidfile "${PIDFILE}" --quiet --exec /usr/bin/tor -- --runasdaemon 1 --PidFile "${PIDFILE}" > /dev/null 2>&1 |
88 |
eend $? |
89 |
} |
90 |
|
91 |
stop() { |
92 |
ebegin "Stopping Tor" |
93 |
start-stop-daemon --stop --user tor:tor --pidfile "${PIDFILE}" --exec /usr/bin/tor -- --PidFile "${PIDFILE}" |
94 |
eend $? |
95 |
} |
96 |
|
97 |
reload() { |
98 |
if [ ! -f ${PIDFILE} ]; then |
99 |
eerror "${SVCNAME} isn't running" |
100 |
return 1 |
101 |
fi |
102 |
checkconfig || return 1 |
103 |
ebegin "Reloading Tor configuration" |
104 |
start-stop-daemon --stop --oknodo --signal HUP --pidfile ${PIDFILE} |
105 |
eend $? |
106 |
} |