Nukesor / pueue

:stars: Manage your shell commands.
MIT License
4.68k stars 128 forks source link

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

Closed rycee closed 4 months ago

rycee commented 4 months ago

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

Nukesor commented 4 months ago

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 :+1:

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Nukesor commented 4 months ago

Classic changelog merge conflict -.-

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

github-actions[bot] commented 4 months ago

Test Results

  3 files  ±0   22 suites  ±0   2m 40s :stopwatch: +3s 145 tests ±0  145 :white_check_mark: ±0  0 :zzz: ±0  0 :x: ±0  310 runs  ±0  310 :white_check_mark: ±0  0 :zzz: ±0  0 :x: ±0 

Results for commit a355e724. ± Comparison against base commit 6fd3f7cf.

:recycle: This comment has been updated with latest results.

rycee commented 4 months ago

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

rycee commented 4 months ago

Thanks!

Nukesor commented 4 months ago

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

rycee commented 4 months ago

That would be great, much appreciated!