[tor-bugs] #15435 [Tor]: Tor should not close stdin on child processes.

Tor Bug Tracker & Wiki blackhole at torproject.org
Sun Mar 22 13:16:16 UTC 2015


#15435: Tor should not close stdin on child processes.
--------------------------------------+------------------------------------
 Reporter:  yawning                   |          Owner:
     Type:  enhancement               |         Status:  new
 Priority:  normal                    |      Milestone:  Tor: 0.2.7.x-final
Component:  Tor                       |        Version:  Tor: unspecified
 Keywords:  tor-pt, needs-spec-patch  |  Actual Points:
Parent ID:                            |         Points:
--------------------------------------+------------------------------------
 The lack of PTs having a reliable way to detect if tor is dead reared it's
 ugly head again in the form of #15434.  There aren't that many good ways
 to detect if a parent has died, beyond checking if stdin is still open
 (Proposed in #10047), but tor explicitly closes the child process's stdin.

 Since a variant of this has been working well, I propose that we make it
 official like thus:
  * Add a new enviornment variable of the form `PT_EXIT_ON_STDIN_CLOSE=1`,
 indicating that Tor will not close the stdin.
  * PTs SHOULD terminate as if they have received a SIGTERM, on stdin being
 closed if the environment variable is set.
  * All new tor versions will naturally set said env. var, and setup the pt
 plugin stdin correctly.

 This does mean that Bridges will consume one extra file descriptor per
 `ServerTransportPlugin` line in the torrc, but I view this as acceptable
 given the fact that this will bring some much needed sanity to our cleanup
 process.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/15435>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list