Discussion:
[tor-talk] Tor already running
Aaron Paden
2012-08-23 23:25:49 UTC
Permalink
Hi,
This is a simple issue, but important. The script should check to see if
Tor/Vidalia is already running and just open the browser. As it is, if I
close the browser, come back some time later, and click the Tor icon, it
results in an error because Tor is still running in the background. I
can't open urls from other applications with the browser for the same
reason.
Aaron Paden
2012-08-24 18:13:09 UTC
Permalink
If you built your package from scratch in some version of Unix, you'll
have to close Tor manually. People who know how to build packages from
scratch in Unix are expected to know how to close Tor manually, and/or
how to hack the Browser source code so that closing the Browser also
closes Vidalia and stops Tor.
Are you a dev for the browser bundle? Your expectations are unrealistic.
Most people using Linux do not build their own packages, they use
packages built for them by the distribution maintainers. Some
distributions will patch packages to suit their needs, but others don't
make decisions that should be made upstream as a matter of policy and
only provide vanilla packages.

I'm making a suggestion for the official package. That is allowed,
right? This is an open-sourced project, right? You're in luck, though, I
do know some programming/scripting. I'll look into the problem myself if
you're interested in a patch.

IMO, the ideal behavior is that tor will continue running. Some people
use the proxy for other applications. The script should check to see if
Vidalia is already running, and if so, just launch the browser. If you
prefer the behavior be consistent with Windows, though, I'll do that
instead.
adrelanos
2012-08-24 19:13:55 UTC
Permalink
Post by Aaron Paden
If you built your package from scratch in some version of Unix, you'll
have to close Tor manually. People who know how to build packages from
scratch in Unix are expected to know how to close Tor manually, and/or
how to hack the Browser source code so that closing the Browser also
closes Vidalia and stops Tor.
Are you a dev for the browser bundle? Your expectations are unrealistic.
Most people using Linux do not build their own packages, they use
packages built for them by the distribution maintainers. Some
distributions will patch packages to suit their needs, but others don't
make decisions that should be made upstream as a matter of policy and
only provide vanilla packages.
Agreed.
Post by Aaron Paden
I'm making a suggestion for the official package. That is allowed,
right?
Yes.
Post by Aaron Paden
This is an open-sourced project, right?
Yes.
Post by Aaron Paden
You're in luck, though, I
do know some programming/scripting. I'll look into the problem myself if
you're interested in a patch.
Great! The problem is considered a bug. (Stated somewhere in Tor FAQ.) I
don't know if there is already a trac ticket for this bug. If not, we
must create one.
Post by Aaron Paden
IMO, the ideal behavior is that tor will continue running.
Tor and Vidalia should continue running.
Post by Aaron Paden
Some people
use the proxy for other applications. The script should check to see if
Vidalia is already running, and if so, just launch the browser. If you
prefer the behavior be consistent with Windows, though, I'll do that
instead.
Let's work out any ideal and/or by Mike Perry accepted solution.

In my ticket [1], related to the linux startup script, Mike said "For
Linux, that sounds great. However on Mac and Windows? Not sure. Of
course, that need not block your Linux implementation as far as I'm
concerned", so feel free start fixing either Linux or Windows and fix
the other one afterwards or not.

Since we are offering patches, it might make sense to discuss this on
tor-dev and/or on IRC with mikeperry.

[1] https://trac.torproject.org/projects/tor/ticket/5611
Robert Ransom
2012-08-24 19:26:17 UTC
Permalink
Post by Aaron Paden
If you built your package from scratch in some version of Unix, you'll
have to close Tor manually. People who know how to build packages from
scratch in Unix are expected to know how to close Tor manually, and/or
how to hack the Browser source code so that closing the Browser also
closes Vidalia and stops Tor.
Are you a dev for the browser bundle?
As far as I know, ?bao song? has never contributed to Tor Browser
Bundle. (A search of https://gitweb.torproject.org/torbrowser.git did
not find any occurrences of ?Bao Song? in the repository history.)

Users are not expected to compile Tor Browser Bundle for themselves.


Robert Ransom
Robert Ransom
2012-08-24 20:03:04 UTC
Permalink
Post by Aaron Paden
This is a simple issue, but important. The script should check to see if
Tor/Vidalia is already running and just open the browser. As it is, if I
close the browser, come back some time later, and click the Tor icon, it
results in an error because Tor is still running in the background.
This is rather hard to do reliably and safely from a shell script, but
other people have asked for this feature too. See
https://bugs.torproject.org/6023 .
Post by Aaron Paden
I
can't open urls from other applications with the browser for the same
reason.
No, this is because TBB-Firefox has to be started with the -no-remote
option so that it won't conflict with a non-TBB Firefox.


Robert Ransom
Aaron Paden
2012-08-24 21:10:47 UTC
Permalink
Post by Robert Ransom
Post by Aaron Paden
This is a simple issue, but important. The script should check to see if
Tor/Vidalia is already running and just open the browser. As it is, if I
close the browser, come back some time later, and click the Tor icon, it
results in an error because Tor is still running in the background.
This is rather hard to do reliably and safely from a shell script, but
other people have asked for this feature too. See
https://bugs.torproject.org/6023 .
Sorry about that. I would have searched the tracker, but I didn't see
it. I was thinking for a second there that you didn't have one.
Sometimes I fail at using the Internet.

So I'm not an expert in shell or anything. I know there are a lot of
gotchas. It seems like it should be possible, though. Is there something
wrong with using pgrep or something?
Post by Robert Ransom
Post by Aaron Paden
I
can't open urls from other applications with the browser for the same
reason.
No, this is because TBB-Firefox has to be started with the -no-remote
option so that it won't conflict with a non-TBB Firefox.
Robert Ransom
Oh. I got no ideas for that. :/
Robert Ransom
2012-08-24 21:29:21 UTC
Permalink
Post by Aaron Paden
Sorry about that. I would have searched the tracker, but I didn't see
it. I was thinking for a second there that you didn't have one.
Sometimes I fail at using the Internet.
It took me several minutes of reading the list of tickets in that
?component? to find that ticket.
Post by Aaron Paden
So I'm not an expert in shell or anything. I know there are a lot of
gotchas. It seems like it should be possible, though. Is there something
wrong with using pgrep or something?
Several things:

* pgrep isn't POSIX, and it isn't in GNU coreutils (as of version
8.13), so it probably won't exist on someone's Linux system.
* pgrep only indicates that there is some process named ?tor? (or
?vidalia?) running, not that the specific Tor or Vidalia shipped in
TBB is running.
* There is currently no way for any program not started by TBB-Vidalia
to determine which ports TBB-Tor is listening on, and there is no way
for any such program to determine what control-port password Torbutton
will need in order to send TBB-Tor a ?SIGNAL NEWNYM? command (required
for the ?New Identity? command to work). (See also
https://bugs.torproject.org/6609 .)


Robert Ransom
adrelanos
2012-08-24 21:51:52 UTC
Permalink
Post by Robert Ransom
Post by Aaron Paden
Sorry about that. I would have searched the tracker, but I didn't see
it. I was thinking for a second there that you didn't have one.
Sometimes I fail at using the Internet.
It took me several minutes of reading the list of tickets in that
?component? to find that ticket.
Post by Aaron Paden
So I'm not an expert in shell or anything. I know there are a lot of
gotchas. It seems like it should be possible, though. Is there something
wrong with using pgrep or something?
* pgrep isn't POSIX, and it isn't in GNU coreutils (as of version
8.13), so it probably won't exist on someone's Linux system.
That's a really esoteric thing. Any half recent Linux system will have
it installed?

If not, in long run there will (hopefully) be packages and TBB should
depend on pgrep (if decided to use it).
https://trac.torproject.org/projects/tor/ticket/5236
https://trac.torproject.org/projects/tor/ticket/3994

If Mike wants to fulfill the esoteric requirement to POSIX and coreutils
pre 8.13 compatible, the script could test if pgrep exists and leave
them with the current behavior.
Post by Robert Ransom
* pgrep only indicates that there is some process named ?tor? (or
?vidalia?) running, not that the specific Tor or Vidalia shipped in
TBB is running.
I fail to see the problem? Please elaborate. Tor Browser should also be
compatible with system wide installed Tor/Vidalia. (i.e. apt-get install
tor vidalia)
Post by Robert Ransom
* There is currently no way for any program not started by TBB-Vidalia
to determine which ports TBB-Tor is listening on, and there is no way
for any such program to determine what control-port password Torbutton
will need in order to send TBB-Tor a ?SIGNAL NEWNYM? command (required
for the ?New Identity? command to work). (See also
https://bugs.torproject.org/6609 .)
What's the suggested solution here? Why not write those data into a file
or environment variable?
Robert Ransom
2012-08-24 23:00:26 UTC
Permalink
Post by adrelanos
Post by Robert Ransom
Post by Aaron Paden
So I'm not an expert in shell or anything. I know there are a lot of
gotchas. It seems like it should be possible, though. Is there something
wrong with using pgrep or something?
* pgrep isn't POSIX, and it isn't in GNU coreutils (as of version
8.13), so it probably won't exist on someone's Linux system.
That's a really esoteric thing. Any half recent Linux system will have
it installed?
POSIX is not esoteric. But there is a pgrep in the ?procps? package,
which contains the POSIX-required ps command, and FreeBSD ships with a
pgrep, so pgrep should be available everywhere TBB for Linux can be
run anyway.
Post by adrelanos
If not, in long run there will (hopefully) be packages and TBB should
depend on pgrep (if decided to use it).
No. If the Tor Browser is packaged properly for a Linux distribution,
it will be configured to use a system-wide Tor instance, and it won't
use any of the startup crap that TBB includes.
Post by adrelanos
If Mike wants to fulfill the esoteric requirement to POSIX and coreutils
pre 8.13 compatible, the script could test if pgrep exists and leave
them with the current behavior.
I assumed that if pgrep were ubiquitous on Linux systems, it would be
in coreutils (bad assumption), so I looked there. I only stated the
version of coreutils that I checked because I didn't want to go hunt
for the most recent version of coreutils.
Post by adrelanos
Post by Robert Ransom
* pgrep only indicates that there is some process named ?tor? (or
?vidalia?) running, not that the specific Tor or Vidalia shipped in
TBB is running.
I fail to see the problem? Please elaborate. Tor Browser should also be
compatible with system wide installed Tor/Vidalia. (i.e. apt-get install
tor vidalia)
No. TBB is intended to not interact with a system-wide Tor instance in any way.
Post by adrelanos
Post by Robert Ransom
* There is currently no way for any program not started by TBB-Vidalia
to determine which ports TBB-Tor is listening on, and there is no way
for any such program to determine what control-port password Torbutton
will need in order to send TBB-Tor a ?SIGNAL NEWNYM? command (required
for the ?New Identity? command to work). (See also
https://bugs.torproject.org/6609 .)
What's the suggested solution here? Why not write those data into a file
or environment variable?
TBB-Vidalia does write all of that information into environment
variables, which is why only programs which it starts have easy access
to it. The control-port password will never be written to a file
because any attacker who can authenticate to a Tor instance's control
port can completely destroy its user's anonymity.


Robert Ransom
Aaron Paden
2012-08-25 00:46:13 UTC
Permalink
Post by Robert Ransom
No. If the Tor Browser is packaged properly for a Linux distribution,
it will be configured to use a system-wide Tor instance, and it won't
use any of the startup crap that TBB includes.
Ok. I was thinking of Tor Browser and the bundle as the same thing. To
confirm, you're saying the bundle as provided is only for local
installation? But wouldn't installing the browser globally necessarily
conflict with Firefox? It's useful to have both...

What do you recommend for packagers?
Post by Robert Ransom
No. TBB is intended to not interact with a system-wide Tor instance in any way.
Is there any reason to have multiple instances of Tor open?
Post by Robert Ransom
Post by adrelanos
Post by Robert Ransom
* There is currently no way for any program not started by TBB-Vidalia
to determine which ports TBB-Tor is listening on, and there is no way
for any such program to determine what control-port password Torbutton
will need in order to send TBB-Tor a ?SIGNAL NEWNYM? command (required
for the ?New Identity? command to work). (See also
https://bugs.torproject.org/6609 .)
What's the suggested solution here? Why not write those data into a file
or environment variable?
TBB-Vidalia does write all of that information into environment
variables, which is why only programs which it starts have easy access
to it. The control-port password will never be written to a file
because any attacker who can authenticate to a Tor instance's control
port can completely destroy its user's anonymity.
Ok, I've looked through the script. Seems like it just tells Vidalia
where the Tor Browser is located. Perhaps Vidalia itself should have a
flag to relaunch the browser.

Continue reading on narkive:
Loading...