Skip to content

Commit

Permalink
Merge pull request #2260 from whirm/anontunnel_unit_update
Browse files Browse the repository at this point in the history
Anontunnel unit update
  • Loading branch information
whirm committed Jun 6, 2016
2 parents 03685f3 + 9682849 commit 3f7699f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
7 changes: 4 additions & 3 deletions systemd/anontunnel_helper@.service
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ User=tunnel_helper
Group=tunnel_helper
Restart=always
Environment=HOME=/var/lib/tunnel_helper/%I
Environment=EXIT_ENABLED=false
Environment=PYTHONPATH=.
Environment=EXTRA_TUNNEL_ARGS=--
Environment=PYTHONPATH=/opt/tribler

WorkingDirectory=/opt/tribler
ExecStartPre=/bin/mkdir -p ${HOME}
ExecStart=/usr/bin/python2 /opt/tribler/Tribler/community/tunnel/main.py -x ${EXIT_ENABLED}
ExecStart=/usr/bin/twistd --nodaemon --logfile=- --pidfile= tunnel_helper ${EXTRA_TUNNEL_ARGS}

[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import os
import signal

from twisted.logger import globalLogPublisher

from Tribler.dispersy.crypto import NoVerifyCrypto, NoCrypto
# from dispersy.discovery.community import DiscoveryCommunity
from Tribler.dispersy.dispersy import Dispersy
Expand All @@ -27,7 +25,7 @@
from Tribler.dispersy.tool.clean_observers import clean_twisted_observers


clean_twisted_observers(globalLogPublisher)
clean_twisted_observers()


class BartercastCrawler(Dispersy):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
# the globalLogPublisher in the current version of Twisted.
# So we make it a conditional import.
try:
from twisted.logger import globalLogPublisher

global_log_publisher_available = True
except:
pass
Expand Down Expand Up @@ -163,8 +161,7 @@ def clean_messages(self):
if now - 3600 > self.crawl_message[k]['time']:
self.crawl_message.pop(k)

if global_log_publisher_available:
clean_twisted_observers(globalLogPublisher)
clean_twisted_observers()

def build_history(self):
self.history_stats.append(self.get_stats())
Expand Down Expand Up @@ -456,7 +453,7 @@ def start_tunnel(self, options):
else:
settings.socks_listen_ports = [random.randint(1000, 65535) for _ in range(5)]

settings.become_exitnode = options["exit"]
settings.become_exitnode = bool(options["exit"])
if settings.become_exitnode:
logger.info("Exit-node enabled")
else:
Expand Down

0 comments on commit 3f7699f

Please sign in to comment.