Skip to content

Handle signals using sd-event#7

Open
ahmubashshir wants to merge 3 commits into
freeotp:masterfrom
ahm-forks:sd-event-signal
Open

Handle signals using sd-event#7
ahmubashshir wants to merge 3 commits into
freeotp:masterfrom
ahm-forks:sd-event-signal

Conversation

@ahmubashshir

Copy link
Copy Markdown
  • Handle signals properly using sd-event
  • Add structured, compile-time debug logging

Use`sd-event` to process signals, as `sd_bus_wait()` blocked all
signals except `KILL` due to internal `ppoll` call.

Signed-off-by: Mubashshir <ahmubashshir@gmail.com>
Implemented structured logging with multiple levels (DEBUG, INFO, WARN,
ERROR, FATAL). Replaced error handling with `ABORT()` for better logging
and termination on critical errors.

Signed-off-by: Mubashshir <ahmubashshir@gmail.com>
Copilot AI review requested due to automatic review settings June 15, 2026 18:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR refactors the build and runtime to support optional debug logging and migrates the main loop from manual sd_bus_wait/process to a systemd sd-event driven loop.

Changes:

  • Introduces a shared c_args list in Meson and conditionally defines ENABLE_DEBUG.
  • Adds structured logging helpers/macros and extra debug statements.
  • Switches main execution to sd_event_loop() and attaches sd-bus + signal handling to that event loop.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
meson.build Centralizes compiler flags and adds conditional -DENABLE_DEBUG for debug builds.
jelling.c Adds logging utilities and migrates runtime control flow to sd-event with signal integration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread meson.build Outdated
Comment thread jelling.c
Comment thread jelling.c
Comment thread jelling.c Outdated
Comment thread jelling.c Outdated
Comment thread jelling.c Outdated
Comment thread jelling.c Outdated
Signed-off-by: Mubashshir <ahmubashshir@gmail.com>
@ahmubashshir ahmubashshir force-pushed the sd-event-signal branch 4 times, most recently from 55c05e1 to 2efb12c Compare June 18, 2026 18:31
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