Skip to content

How to handle Ctrl+C/SIGINT with own code #2395

Answered by SergioBenitez
Whanos asked this question in Questions
Discussion options

You must be logged in to vote

You simply need to disable Rocket's default handler. See the config guide and API docs for how: https://rocket.rs/v0.5-rc/guide/configuration/ and https://api.rocket.rs/v0.5-rc/rocket/config/struct.Shutdown.html#example. If you want to shutdown as well, then you'll need to call shutdown() from your signal handler.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Whanos
Comment options

Answer selected by Whanos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants