make tor restart more aggressive as last resort for tor-death bug

This commit is contained in:
Kevin Froman 2019-08-11 13:53:38 -05:00
parent 3e99bd3a83
commit 00e2445475
2 changed files with 8 additions and 4 deletions

View File

@ -61,4 +61,4 @@ def handle_daemon_commands(comm_inst):
localcommand.local_command('queueResponseAdd/' + cmd[4], post=True, postData={'data': response}) localcommand.local_command('queueResponseAdd/' + cmd[4], post=True, postData={'data': response})
response = '' response = ''
comm_inst.decrementThreadCount('handle_daemon_commands') comm_inst.decrementThreadCount('handle_daemon_commands')

View File

@ -17,11 +17,12 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
''' '''
import os, sys, base64, subprocess, signal import os, sys, base64, subprocess, signal, time
import config, logger import config, logger
from . import getopenport from . import getopenport
from utils import identifyhome from utils import identifyhome
config.reload() config.reload()
TOR_KILL_WAIT = 3
class NetController: class NetController:
''' '''
This class handles hidden service setup on Tor and I2P This class handles hidden service setup on Tor and I2P
@ -179,5 +180,8 @@ HiddenServicePort 80 ''' + self.apiServerIP + ''':''' + str(self.hsPort)
pass pass
except FileNotFoundError: except FileNotFoundError:
pass pass
time.sleep(TOR_KILL_WAIT)
return try:
os.kill(int(pidN), signal.SIGKILL)
except (ProcessLookupError, PermissionError) as e:
pass