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

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

On Wed, Apr 06, 2005 at 02:09:16PM -0400, Roger Dingledine wrote:
> 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/?

That's pretty trivial:

while( sleep 1 ) {
        my $ReturnCode = system( '/usr/local/bin/tor -f /etc/torrc' );
        last unless $ReturnCode;

But you could just use this command:
perl -e "while(sleep 1){\$r=system('tor -f /etc/torrc');last unless \$r;}"
Ewige Blumenkraft!         )|( ssc                    www.unix-geek.info
                               Stephan Schmieder             ssc@xxxxxxx

safeguard this letter, it may be an IMPORTANT DOCUMENT

Attachment: pgpOCWRwP83sf.pgp
Description: PGP signature