Opened 7 years ago

Closed 7 years ago

#7677 closed defect (fixed)

stem.process.launch_tor() hangs without stdout

Reported by: atagar Owned by: atagar
Priority: Low Milestone:
Component: Core Tor/Stem Version:
Severity: Keywords: controller easy
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

If the user has a tor configuration that precludes logging to stdout, such as...

tor_process = stem.process.launch_tor_with_config(
  config = {
    'ControlPort': '2778',
    'Log': 'NOTICE file /tmp/tor_log',
  },
)

... then the launch_tor() call will never return. This is because it checks the initialization output to determine when the process has bootstrapped.

I'm not sure of the best way of handling this. Note the issue in the pydocs? Slip in a 'Log NOTICE stdout' option? Skip listening for bootstrapping if there's no stdout?

For now just filing a ticket while trying to sort out other issues.

Child Tickets

Change History (7)

comment:1 Changed 7 years ago by atagar

Keywords: controller added

comment:2 Changed 7 years ago by arma

You could, as an alternate (or even primary) approach, listen for bootstrapping events from Tor rather than trying to parse its logs.

If you do this, be sure to do a getinfo once you're listening, to catch up on whatever bootstrapping points you missed before you connected the controller to Tor.

comment:3 Changed 7 years ago by atagar

Thanks, but that would require for us to connect to the instance. It might not be configured with an open control port/socket, and even if it does have one it might be configured to use password authentication (making launch_tor() then need a password argument to work).

comment:4 Changed 7 years ago by arma

You could pass along a "log 'notice stdout'" command-line option when you start Tor?

comment:5 Changed 7 years ago by atagar

You could pass along a "log 'notice stdout'" command-line option when you start Tor?

Yup. That's what I meant with the "Slip in a 'Log NOTICE stdout' option?" idea I mentioned above. At the moment that's what I'm leaning toward.

comment:6 Changed 7 years ago by atagar

Keywords: easy added

comment:7 Changed 7 years ago by atagar

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.