[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: script to magically restart tor [was: Re: disappearing nodes]

On Sun, Mar 20, 2005 at 12:01:04AM +0100, ssc@xxxxxxxxxxxxxxx wrote:
> On Sat, Mar 19, 2005 at 03:35:26PM -0700, jeff wrote:
> > And...tor has crashed a couple times without me noticing for a day or 
> > two. I haven't written any script to automagickally restart it.
> I've written a little perl script to do that a couple of weeks ago.
> It's nothing fancy,
> but may save you the 10 minutes it takes to hack it yourself.
> https://h07.org/~ssc/wiki/doku.php?id=kor.pl

This sort of thing is trickier than it seems. The Tor directories include
a list of "recommended" versions, and your Tor client/server examines
the directory, compares the list to its own version, and auto shuts down
if it's running a version that we no longer recommend.

This is so we can break compatibility and make obsolete clients go away,
and it's also so we can quickly unrecommend certain versions when we
find a serious security hole (which has happened several times).

But if you run your Tor inside a loop as you describe above, then it
will start, decide to die, start again, ad infinitum.

We still have a few people out there on the Internet running Tor 0.0.6
inside a loop like this; it's why I implemented the DirPolicy config
option for dirservers, so we can reuse to serve directories to certain
people -- they were asking for a new directory every time they restarted,
many times a second.

We currently exit(0) when we're obsolete. I don't believe we exit with
that status code anywhere else, except if you sigint or sigterm tor.

So perhaps scripts like this should check the status code and only
restart if there was a problem? Can somebody volunteer to sort this out
and provide a recommended script we can put in tor/contrib/?