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

Re: [tor-bugs] #8908 [Tor]: Tor systemd socket activation support



#8908: Tor systemd socket activation support
-------------------------+--------------------------------------------------
 Reporter:  cypherpunks  |          Owner:  cypherpunks       
     Type:  enhancement  |         Status:  needs_review      
 Priority:  normal       |      Milestone:  Tor: 0.2.5.x-final
Component:  Tor          |        Version:  Tor: unspecified  
 Keywords:               |         Parent:                    
   Points:               |   Actualpoints:                    
-------------------------+--------------------------------------------------

Comment(by nickm):

 This actually looks reasonably solid.  Here are a few points we should
 think about:
   * Does it actually work to only start Tor when Tor receives a SocksPort
 or ControlPort request?  When Tor first starts after significant downtime,
 it needs to download a pretty big amount of directory data, and build
 enough circuits for user traffic.  Does that happen fast enough to answer
 the request that made systemd launch Tor?
   * A Tor is _supposed_ to actually turn itself nearly off when it sees no
 user traffic.  Does your need for this feature mean that feature is not
 working?
   * If this is incompatible with hibernation, shouldn't we detect its use
 along with hibernation, and warn the user?
   * It appears that we do systemd socket discovery by default,
 unconditionally.  Can that be right?
   * I would like if the implementation in Tor (that is, the parts outside
 of the sd-daemon.c code) were not systemd-specific.  For example, it would
 also be nice to have the ability to write a little launcher program that
 bound to some low ports, then did a setuid(tor-daemon) and exec()d Tor.
 That program might want to pass a list of fds via the command line.  For
 such a program, it would make sense to reuse 90% of this code, but have
 the fds come from some source other than sd-daemon.c.
   * There are no unit tests for this code at all.  Is there anything we
 can do to make this tested?  I would love for 0.2.5 to be the release
 where we stop adding untested code.


 Minor nitpicks:
   * The new C code in Tor doesn't follow K&R indentation style like the
 rest of Tor.
   * I bet when we go to compile this on windows, we'll find at least one
 or two more methods that should have been wrapped in #ifndef _WIN32.

 I can look at the code in more detail later, but I figured a rapid review
 here would be of benefit.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/8908#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs