Opened 7 years ago

Closed 6 years ago

Last modified 5 years ago

#2302 closed enhancement (duplicate)

Controller event for sighup and shutdown

Reported by: atagar Owned by:
Priority: Medium Milestone: Tor: 0.2.3.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: easy tor-relay
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

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

Child Tickets

Change History (5)

comment:1 Changed 7 years ago by special

A 'SIGNAL' event was implemented in #1955 - including SIGHUP. There isn't anything reliable for quitting yet, though.

comment:2 Changed 7 years ago by nickm

Milestone: Tor: 0.2.3.x-final

I'd like to see this in 0.2.3.x if we can find a way to use it for controllers to get notified about assertion failures and the like so that users don't get confused.

comment:3 Changed 6 years ago by rransom

Resolution: duplicate
Status: newclosed

The ‘notify controllers about assertion failures’ ticket is #2191. The ‘the way we [flush the controller connection if we're about to shut down] now won't work right with bufferevents’ ticket is #3367. I don't see anything else to be done for this ticket, so I'm closing it as a duplicate.

comment:4 Changed 5 years ago by nickm

Keywords: tor-relay added

comment:5 Changed 5 years ago by nickm

Component: Tor RelayTor
Note: See TracTickets for help on using tickets.