[tor-bugs] #2302 [Tor Relay]: Controller event for sighup and shutdown

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Sun Dec 19 07:29:13 UTC 2010


#2302: Controller event for sighup and shutdown
-------------------------+--------------------------------------------------
 Reporter:  atagar       |       Owner:     
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:     
Component:  Tor Relay    |     Version:     
 Keywords:  easy         |      Parent:     
-------------------------+--------------------------------------------------
 A while back Nick and I discussed adding a controller event for sighups.
 This isn't something that I'll be getting to any time soon but, it would
 be a nice addition at some point.

 10:15 < nickm> atagar: answering on the ticket. thanks for the poke
 10:23 < nickm> there
 10:25 < atagar> thx
 10:25 < nickm> BTW, are there a lot of log messages that arm parses?
 10:26 < nickm> Are some of them things that should turn into events of
 some kind?
 10:28 < atagar> arm tracks NOTICE events for sighup/shutdown,
 NEWDESC/NS/NEWCONSENSUS to updated cached results, and BW as a
 heartbeat
 10:28 < nickm> So one of these things is not like the others
 10:29 < nickm> The content of BW and NEWDESC/NS/NEWCONSENSUS are
 explicitly defined parts of the API.
 10:30 < nickm> NOTICE stuff is just log messages, and not guaranteed
 to have any particular format.
 10:30 < atagar> yup
 10:30 < nickm> So probably we should have an event for "we got a
 signal" or "we're shutting down"
 10:30 < nickm> Those both _do_ sound like STATUS_GENERAL events
 10:31 < nickm> If we don't have STATUS events for those already, we
 should
 10:31 < atagar> hmm, I haven't checked - I'll look into it when adding the
 'conf changed' event type
 10:32 < nickm> maybe write up what the event should look like before
 you start hacking ?
 10:32 < atagar> Are you thinking a proposal? It would be kinda
 short...
 10:33 < nickm> If you want.  It could also just be in the form of
 writing the patch to control-spec.txt before you write the code
 10:33 < special> +1 on a control event for signals, especially HUP.
 10:36 < nickm> That one should be trivial; just add the right call to
 signal_callback in main.c.  You probably don't want to report signals that
 Tor ignores, and you'll want to convert signals to names, but other than
 that, it cake.
 10:37 < nickm> shutting down is a little more complicated, since there are
 a couple of ways to do it
 10:37 < nickm> oh, and we'll probably want a way to special-case
 trying to flush the controller connection if we're about to shut
 down.
 10:39 < nickm> Hm.  The way we do that now won't work right with
 bufferevents.  One More Thing To Fix. :p

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


More information about the tor-bugs mailing list