Add SIGHUP cleanup handling #46

Closed
opened 2026-05-12 00:49:22 -04:00 by JackFrostbyte · 0 comments

Context

RGB Aura currently handles SIGTERM and KeyboardInterrupt, but not SIGHUP.

During manual terminal runs, shell/session closes can leave LEDs in the last animated frame instead of restoring the configured safe color. Adding SIGHUP handling should make cleanup behavior more consistent.

Scope

  • Add SIGHUP handling alongside the existing signal handling.
  • Reuse the same clean shutdown path used by SIGTERM.
  • Avoid duplicating shutdown logic.
  • Ensure the implementation remains safe on platforms where SIGHUP may not exist.

Acceptance criteria

  • SIGHUP triggers the same clean shutdown behavior as SIGTERM.
  • LEDs are restored according to the configured shutdown behavior.
  • Existing SIGTERM and KeyboardInterrupt behavior remains unchanged.
  • ruff format passes.
  • ruff check passes.
  • Tests pass where applicable.

Branch workflow

Base branch:

develop

Suggested work branch:

fix/issue-46-add-sighup-cleanup

Pull request target:

develop

Do not merge directly into main. main should only receive tested release-ready changes from develop.

## Context RGB Aura currently handles `SIGTERM` and `KeyboardInterrupt`, but not `SIGHUP`. During manual terminal runs, shell/session closes can leave LEDs in the last animated frame instead of restoring the configured safe color. Adding `SIGHUP` handling should make cleanup behavior more consistent. ## Scope - Add `SIGHUP` handling alongside the existing signal handling. - Reuse the same clean shutdown path used by `SIGTERM`. - Avoid duplicating shutdown logic. - Ensure the implementation remains safe on platforms where `SIGHUP` may not exist. ## Acceptance criteria - `SIGHUP` triggers the same clean shutdown behavior as `SIGTERM`. - LEDs are restored according to the configured shutdown behavior. - Existing `SIGTERM` and `KeyboardInterrupt` behavior remains unchanged. - `ruff format` passes. - `ruff check` passes. - Tests pass where applicable. ## Branch workflow Base branch: `develop` Suggested work branch: `fix/issue-46-add-sighup-cleanup` Pull request target: `develop` Do not merge directly into `main`. `main` should only receive tested release-ready changes from `develop`.
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JackFrostbyte/rgb-aura#46
No description provided.