Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 75381

Summary: net-misc/tor
Product: Gentoo Linux Reporter: Faustus <orlovm>
Component: New packagesAssignee: Peter Johanson (RETIRED) <latexer>
Status: RESOLVED FIXED    
Severity: minor CC: humpback
Priority: High    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: tor-0.0.9.4-r1.ebuild
tor.initd

Description Faustus 2004-12-22 16:12:37 UTC
Tor package lacks an init.d script, and sensible configuration as a client.

Here's what I did, hopefully it's translatable to ebuild :)

Create user/group tor:tor, home directory /var/lib/tor
Create dirs /var/lib/tor and /var/log/tor (750) owned by tor:tor

In /etc/init.d/tor:
(the HOME thing is because tor tries to stat ~/.tor)
-------------------
depend() {
        need net
}

start() {
        ebegin "Starting Tor"
        HOME=/var/lib/tor
        start-stop-daemon --start --quiet --chuid tor --exec /usr/bin/tor -- --runasdaemon 1
        eend $?
}

stop() {
        ebegin "Stopping Tor"
        start-stop-daemon --stop --quiet --chuid tor --exec /usr/bin/tor
        eend $?
}

In /etc/tor/torrc:
------------------
User tor
Group tor

HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 80 127.0.0.1:80
HiddenServiceNodes moria1,moria2

DataDirectory   /var/lib/tor/data
Log notice file /var/log/tor/tor.log

In /etc/privoxy/config:
(this can probably be just printed after merge)
-----------------------
forward-socks4a *.onion localhost:9050 .
Comment 1 Gustavo Felisberto (RETIRED) gentoo-dev 2005-02-10 12:39:52 UTC
Created attachment 50948 [details]
tor-0.0.9.4-r1.ebuild
Comment 2 Gustavo Felisberto (RETIRED) gentoo-dev 2005-02-10 12:41:30 UTC
Created attachment 50949 [details]
tor.initd

Place this file in files before emerging previous ebuild.
I did not test that it will run ok, i just used the ideas and hacked it
together.
Comment 3 Gustavo Felisberto (RETIRED) gentoo-dev 2005-02-10 12:52:41 UTC
Forgot #!/sbin/runscript at beginning of initd :)
Comment 4 Gustavo Felisberto (RETIRED) gentoo-dev 2005-02-10 18:25:18 UTC
I added this version to portage a few hours ago. Hope all is ok. Please test and report.
Comment 5 Faustus 2005-02-11 04:29:10 UTC
Works fine, thanks!

I think you can close this bug.