Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#1955 closed enhancement (implemented)

Control protocol 'signal' event for when we get a hup, etc

Reported by: arma Owned by:
Priority: Low Milestone: Tor: 0.2.3.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: easy
Cc: special@… Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

It would be good to add a new 'signal' event to the control protocol, so it can tell us when we get a hup, usr1, etc. Mainly this involves adding it to control-spec.txt, and then instrumenting signal_callback() in src/or/main.c to send the event with the right arguments.

Child Tickets

Attachments (1)

0001-Add-a-SIGNAL-event-for-control-connections.patch (5.5 KB) - added by special 9 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 9 years ago by special

Cc: special@… added

comment:2 Changed 9 years ago by nickm

Milestone: Tor: 0.2.3.x-final

So it would. This should be fairly easy for anybody who reads C and can track the control flow for the SIGNAL command from handle_control_signal() down through signal_callback() to do_hup().

comment:3 Changed 9 years ago by nickm

Whoops, I was thinking of a different bug. This one should be fairly easy too, modulo the flushing issues.

Too many tabs open.

comment:4 Changed 9 years ago by special

Status: newneeds_review

Attached a patch implementing this event.

Implementing SHUTDOWN or HALT would require waiting for the control connections to cleanly close on exit. That is pretty far out of scope for this feature, so I documented those as missing.

RELOAD is also slightly misleading. With ReloadTorrcOnSIGHUP, the event will still be sent, but the configuration is not reloaded (the other SIGHUP actions do take place). If this is a concern, one option would be to have both 'RELOAD' and 'HUP' as events.

comment:5 Changed 9 years ago by special

Milestone: Tor: 0.2.3.x-finalTor: 0.2.2.x-final

Changing the milestone to 0.2.2.x as per Sebastian's advice

comment:6 Changed 9 years ago by nickm

Milestone: Tor: 0.2.2.x-finalTor: 0.2.3.x-final

Changing it back; this is too feature-like for the 0.2.2 series, alas.

comment:7 Changed 9 years ago by nickm

Resolution: implemented
Status: needs_reviewclosed

Looks okay on review. Will merge.

For next time, please try "make check-spaces" to make sure you're conforming with our code style, and try adding a file to the changes/ directory for the changelog.

comment:8 Changed 7 years ago by nickm

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