redlib-org / redlib

Private front-end for Reddit
GNU Affero General Public License v3.0
1.38k stars 96 forks source link

fix: gracefully shutdown on CTRL+C and SIGTERM on Linux #273

Open internationalcrisis opened 1 month ago

internationalcrisis commented 1 month ago

When running on Linux, listen for SIGTERM in addition to CTRL+C.

I am not incredibly competent with Rust and Linux is my daily driver, so please double-check my changes. Regardless, this should behave relatively the same on Linux and Windows, past the "Failed to install CTRL+C signal handler" error not appearing on Linux if redlib fails to install that signal handler.

This also fixes #205.