[tor-dev] [GSoC] APAF Report

Damian Johnson atagar at torproject.org
Wed Jun 20 17:04:30 UTC 2012


> Eh... if only tor was also available for use "as software library" (Like
> silvertunnel & OrLib), we would a lot of less "system integration
> complexity"!

Actually, tor *does* provide the pid. I added it a year or two back
because getting it via psutil, proc, or system utilities all had
drawbacks...
https://gitweb.torproject.org/torspec.git/blob/HEAD:/control-spec.txt#l646

The only reason that stem still has pid lookup utilities is so that we
can get the pid *before* connecting to tor, as a workaround for a
longstanding tor bug...
https://trac.torproject.org/4881

... this is now fixed in 0.2.3.11, but before that TBB provided a
relative path for its authentication cookie making it a big pita for
controllers to attach. I needed the pid in order to look up the cwd,
so I could expand the cookie path.

On first glance txtorcon seems to be using psutil as a fallback for
when 'GETINFO process/pid' is unavailable.

That said, there's lots of other useful information that it would be
nice for the control socket to provide (cpu/memory usage and
connection information are high on my wish list).

Cheers! -Damian


More information about the tor-dev mailing list