[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: script to magically restart tor [was: Re: disappearing nodes]
- To: or-talk@xxxxxxxxxxxxx
- Subject: Re: script to magically restart tor [was: Re: disappearing nodes]
- From: Roger Dingledine <arma@xxxxxxx>
- Date: Wed, 6 Apr 2005 14:09:16 -0400
- Delivered-to: firstname.lastname@example.org
- Delivered-to: email@example.com
- Delivered-to: firstname.lastname@example.org
- Delivery-date: Wed, 06 Apr 2005 14:09:41 -0400
- In-reply-to: <20050319230104.GA32276@hzeroseven.org>; from email@example.com on Sun, Mar 20, 2005 at 12:01:04AM +0100
- References: <20050319210849.GA25815@eecs.harvard.edu> <423CA92E.firstname.lastname@example.org> <20050319230104.GA32276@hzeroseven.org>
- Reply-to: or-talk@xxxxxxxxxxxxx
- Sender: owner-or-talk@xxxxxxxxxxxxx
- User-agent: Mutt/126.96.36.199i
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.
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/?