Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 106369 - Improved ebuild and initscript for net-misc/tor
Summary: Improved ebuild and initscript for net-misc/tor
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High enhancement (vote)
Assignee: Gustavo Felisberto (RETIRED)
URL:
Whiteboard:
Keywords: EBUILD
: 107510 111140 113285 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-09-18 08:44 UTC by Jochen Schalanda
Modified: 2006-09-06 08:03 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
tor-0.1.0.14-r2.ebuild (tor-0.1.0.14-r2.ebuild,3.63 KB, text/plain)
2005-09-18 08:45 UTC, Jochen Schalanda
Details
files/tor.confd (tor.confd,321 bytes, text/plain)
2005-09-18 08:45 UTC, Jochen Schalanda
Details
tor.initd (tor.initd,1.20 KB, text/plain)
2005-09-18 08:45 UTC, Jochen Schalanda
Details
files/torrc.sample-0.1.0.14.patch (torrc.sample-0.1.0.14.patch,1.12 KB, text/plain)
2005-09-18 08:46 UTC, Jochen Schalanda
Details
files/tor.confd (tor.confd,321 bytes, text/plain)
2005-09-18 08:49 UTC, Jochen Schalanda
Details
tor-0.1.0.15.ebuild (tor-0.1.0.15.ebuild,3.75 KB, text/plain)
2005-09-24 03:43 UTC, Jochen Schalanda
Details
files/torrc.sample-0.1.0.15.patch (torrc.sample-0.1.0.15.patch,1.12 KB, text/plain)
2005-09-24 03:43 UTC, Jochen Schalanda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jochen Schalanda 2005-09-18 08:44:44 UTC
An improved ebuild for net-misc/tor is attached to this bug. It provides support
for a static version of tor as well as chroot support similar to net-dns/bind.

I tested it only on x86, so I removed the other keywords of
net-misc/tor-0.1.0.14-r1.

Reproducible: Always
Steps to Reproduce:
Comment 1 Jochen Schalanda 2005-09-18 08:45:23 UTC
Created attachment 68735 [details]
tor-0.1.0.14-r2.ebuild
Comment 2 Jochen Schalanda 2005-09-18 08:45:41 UTC
Created attachment 68736 [details]
files/tor.confd
Comment 3 Jochen Schalanda 2005-09-18 08:45:56 UTC
Created attachment 68737 [details]
tor.initd
Comment 4 Jochen Schalanda 2005-09-18 08:46:11 UTC
Created attachment 68738 [details]
files/torrc.sample-0.1.0.14.patch
Comment 5 Jochen Schalanda 2005-09-18 08:49:16 UTC
Created attachment 68739 [details]
files/tor.confd

fixed small typo
Comment 6 Carsten Lohrke (RETIRED) gentoo-dev 2005-09-18 11:53:58 UTC
I suppose tor is depending on openssl and libevent at runtime, too...
Comment 7 Gustavo Felisberto (RETIRED) gentoo-dev 2005-09-18 13:55:33 UTC
There are some problems here:

1- If static is not used the chroot fails probably due to not found libs:
/etc/init.d/tor start
 * Starting chrooted Tor ...
/sbin/start-stop-daemon: Unable to start /usr/bin/tor: No such file or directory
                                                           [ !! ]

And manualy:
 ls -al /chroot/tor/usr/bin/tor
 -rwxr-xr-x  1 root root 475312 Sep 18 21:25 /chroot/tor/usr/bin/tor
 chroot /chroot/tor/ /usr/bin/tor
 chroot: cannot run command `/usr/bin/tor': No such file or directory

If the static use flag is on:

ebuild /var/db/pkg/net-misc/tor-0.1.0.14-r2/tor-0.1.0.14-r2.ebuild config
!!! aux_get(): ebuild path for 'net-misc/tor-0.1.0.14-r2' not specified:
!!!            None
 *
 * Setting up the chroot directory...
 * Creating devices...
 * Adding tor to /chroot/tor/etc/passwd and group...
 * Copying system files...
cp: cannot stat `/lib/libgcc_*.*': No such file or directory
 * Copying dependencies...
cp: cannot stat `dynamic': No such file or directory
 * Copying binaries and config files...
 * Setting permissions...
 * Done.
and then:

/etc/init.d/tor start
 * Starting chrooted Tor ...
Sep 18 21:52:07.413 [notice] Tor v0.1.0.14. This is experimental software. Do
not rely on it for strong anonymity.
Sep 18 21:52:07.414 [err] switch_id(): User 'tor' not found.
Sep 18 21:52:07.415 [err] init_from_config(): Acting on config options left us
in a broken state. Dying.                                    [ !! ]


2- The ebuild config only works for fresh installs if there is an upgrade the
user has to manually remove the chroot and then re-run the config.
Comment 8 Jochen Schalanda 2005-09-19 07:44:58 UTC
@Carsten/comment #6:
You're right. At least the dynamic linked binary has runtime dependencies on
dev-libs/openssl and dev-libs/libevent. I just got these lines from the old
ebuild and assumed they were correct. Should've checked them...


@Gustavo/comment #7:
I have tested my ebuild on 3 different systems and it worked.
The error message "cp: cannot stat `dynamic': No such file or directory"
implies, that you have compiled tor with the static USE flag activated, but
deactivated it afterwards. Maybe you've emerged tor with `USE=static emerge tor`?

About your 2nd question: Yes, after an upgrade you have to rebuild your chroot.
The bind ebuild suffers from the same problem. One could add an upgrade function
to the ebuild, but it would be very bloated in the end.
Comment 9 Jochen Schalanda 2005-09-24 03:43:07 UTC
Created attachment 69152 [details]
tor-0.1.0.15.ebuild

Version bump and minor changes of ebuild.

I've installed tor using this ebuild on 3 different systems with (I at least
think) every combination (dynamic and static in non-chroot environment,
static+chroot, dynamic+chroot). Seemed to work but since Gustavo had problems
with the other ebuild, this should be thoroughly tested.
Comment 10 Jochen Schalanda 2005-09-24 03:43:37 UTC
Created attachment 69153 [details]
files/torrc.sample-0.1.0.15.patch
Comment 11 Gustavo Felisberto (RETIRED) gentoo-dev 2005-09-28 07:09:11 UTC
*** Bug 107510 has been marked as a duplicate of this bug. ***
Comment 12 Daniel Webert 2005-10-01 12:35:20 UTC
using the dyn+chroot overhere on x86 w/o problems.
Comment 13 Jakub Moc (RETIRED) gentoo-dev 2005-11-22 13:53:12 UTC
*** Bug 113285 has been marked as a duplicate of this bug. ***
Comment 14 Spider (RETIRED) gentoo-dev 2005-12-16 03:42:15 UTC
This would do well to include the dualpart service from bug #111140,  however I
do not see any obvious errors in theese builds, although it is preferred to do :


"emerge --config '=${CATEGORY}/${PF}"   than "emerge /var/lib...  config" 
Comment 15 Andrew Dorney 2006-02-06 13:28:42 UTC
0.1.0.16 has been out since January... figured I should put that here verus a new thread. :)

http://tor.eff.org/download.html.en

~~ Andrew D.
Comment 16 Jakub Moc (RETIRED) gentoo-dev 2006-06-26 10:45:08 UTC
*** Bug 111140 has been marked as a duplicate of this bug. ***
Comment 17 Gustavo Felisberto (RETIRED) gentoo-dev 2006-09-06 08:03:51 UTC
The chroot idea works very badly in tor, and I actually never managed to have it working ok. When a better way is available maybe then there will be a chroot tor.