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

fix: make graceful daemon shutdown exit with code 0 #504

Merged
merged 1 commit into from
Mar 5, 2024
Merged

fix: make graceful daemon shutdown exit with code 0 #504

merged 1 commit into from
Mar 5, 2024

Conversation

rycee
Copy link
Contributor

@rycee rycee commented Mar 4, 2024

Description

When shutting down pueued using SIGINT or SIGTERM then the exit code should be zero. This is necessary, for example, when running as a systemd service since systemd will otherwise put the service in a failed state whenever it shuts down.

I'm not sure why it is currently exiting with an error-code. Maybe it is for some good reason? But looking at the code comments it definitely mentions exiting gracefully, which I would interpret as exit code 0.

Checklist

  • I think I picked the correct source and target branch.
  • I included a new entry to the CHANGELOG.md.
  • I checked cargo clippy and cargo fmt. The CI will fail otherwise anyway.
  • (If applicable) I added tests for this feature or adjusted existing tests.
  • (If applicable) I checked if anything in the wiki needs to be changed.

@Nukesor
Copy link
Owner

Nukesor commented Mar 5, 2024

Good point. I'm no longer sure why I let it exit with code 1 to be honest. But I tested for it xD!

Exiting with 0 seems like the correct thing to do 👍

Copy link

codecov bot commented Mar 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.16%. Comparing base (6fd3f7c) to head (a355e72).

Additional details and impacted files
@@               Coverage Diff               @@
##           development     #504      +/-   ##
===============================================
+ Coverage        80.15%   80.16%   +0.01%     
===============================================
  Files               77       77              
  Lines             5673     5673              
===============================================
+ Hits              4547     4548       +1     
+ Misses            1126     1125       -1     

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

@Nukesor
Copy link
Owner

Nukesor commented Mar 5, 2024

Classic changelog merge conflict -.-

I really have to look at automated changelogs at some point.

Copy link

github-actions bot commented Mar 5, 2024

Test Results

  3 files  ±0   22 suites  ±0   2m 40s ⏱️ +3s
145 tests ±0  145 ✅ ±0  0 💤 ±0  0 ❌ ±0 
310 runs  ±0  310 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit a355e72. ± Comparison against base commit 6fd3f7c.

♻️ This comment has been updated with latest results.

When shutting down pueued using SIGINT or SIGTERM then the exit code
should be zero. This is necessary, for example, when running as a
systemd service since systemd will otherwise put the service in a
failed state whenever it shuts down.
@rycee
Copy link
Contributor Author

rycee commented Mar 5, 2024

Cool, thanks! I've rebased the branch with the conflict resolved.

@Nukesor Nukesor merged commit 81e52f0 into Nukesor:development Mar 5, 2024
19 checks passed
@rycee rycee deleted the daemon-graceful-shutdown branch March 5, 2024 18:03
@rycee
Copy link
Contributor Author

rycee commented Mar 5, 2024

Thanks!

@Nukesor
Copy link
Owner

Nukesor commented Mar 6, 2024

Thank you! I'll have to release a new version soon with these changes :D

@rycee
Copy link
Contributor Author

rycee commented Mar 6, 2024

That would be great, much appreciated!

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.

2 participants