Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

system: handle SIGTERM signals #151

Closed
wants to merge 1 commit into from
Closed

Conversation

mrfelton
Copy link
Contributor

This pull request introduces signal handling to gracefully shut down the application upon receiving SIGTERM or SIGINT signals, and updates dependencies accordingly.

Dependency Updates:

  • Cargo.toml: Added the signal feature to the tokio dependency. ([Cargo.tomlL27-R27](https://github.com/lndk-org/lndk/pull/151/files#diff-2e9d962a08321605940b5a657135052fbcef87b5e360662bb527c96d9a615542L27-R27))

Signal Handling Implementation:

  • src/main.rs:
    • Imported signal and SignalKind from tokio::signal::unix. ([src/main.rsL26-R29](https://github.com/lndk-org/lndk/pull/151/files#diff-42cb6807ad74b3e201c5a7ca98b911c5fa08380e942be6e4ac5807f8377f87fcL26-R29))
    • Set up signal handlers for SIGTERM and SIGINT in the main function. ([src/main.rsR123-R126](https://github.com/lndk-org/lndk/pull/151/files#diff-42cb6807ad74b3e201c5a7ca98b911c5fa08380e942be6e4ac5807f8377f87fcR123-R126))
    • Added branches to the select! macro to handle SIGTERM and SIGINT signals, logging a shutdown message for each. ([src/main.rsR137-R142](https://github.com/lndk-org/lndk/pull/151/files#diff-42cb6807ad74b3e201c5a7ca98b911c5fa08380e942be6e4ac5807f8377f87fcR137-R142))

Fixes #150

Copy link

codecov bot commented Aug 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.

Project coverage is 0.00%. Comparing base (259de8b) to head (ef878ee).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
src/main.rs 0.00% 10 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master    #151   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files           1       1           
  Lines         105     115   +10     
======================================
- Misses        105     115   +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@orbitalturtle
Copy link
Collaborator

orbitalturtle commented Aug 28, 2024

Closing since #152 is now merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: lndk process does not respond to a SIGTERM
2 participants