Skip to content

Exit jackdbus cleanly on SIGTERM - #1024

Open
iibaranov-IG wants to merge 1 commit into
jackaudio:developfrom
iibaranov-IG:fix/jackdbus-sigterm
Open

Exit jackdbus cleanly on SIGTERM#1024
iibaranov-IG wants to merge 1 commit into
jackaudio:developfrom
iibaranov-IG:fix/jackdbus-sigterm

Conversation

@iibaranov-IG

Copy link
Copy Markdown

Fixes #971.

jackdbus called jackctl_setup_signals(0), which blocks the termination signals for later consumption by jackctl_wait_signals(). Unlike jackd, however, jackdbus never calls the wait function, so SIGTERM remains blocked indefinitely.

This installs a small async-signal-safe handler that records the requested termination signal in a sig_atomic_t. The existing D-Bus dispatch loop checks that flag and performs the normal controller cleanup path. Its existing 200 ms dispatch timeout bounds the exit delay.

Validation:

  • Reproduced the current behavior in a private D-Bus session: jackdbus remained alive more than 3.2 seconds after SIGTERM and required SIGKILL.
  • With this change, the same process exited through its normal cleanup path in about 214 ms with status 0.
  • Confirmed the log records Controller received signal 15 and Controller deactivated.
  • Completed a full python3 ./waf configure --dbus --classic and python3 ./waf build -j2 build in a clean Debian environment.

@iibaranov-IG
iibaranov-IG changed the base branch from master to develop September 11, 2026 20:28
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.

jack-dbus delays shutdown when dbus-broker-units (systemd) are in use

1 participant