khvzak / bluez-tools

A set of tools to manage bluetooth devices for linux
GNU General Public License v2.0
176 stars 51 forks source link

bt-agent doesn't gracefully shutdown on SIGTERM #30

Open martin-rufilla opened 4 years ago

martin-rufilla commented 4 years ago

In bt-agent.c you have registered the wrong signal handlers, usr1_signal_handler for SIGTERM and term_signal_handler for SIGUSR1.

/* Add SIGTERM/SIGINT/SIGUSR1 handlers */
g_unix_signal_add (SIGTERM, usr1_signal_handler, NULL);
g_unix_signal_add (SIGINT, term_signal_handler, NULL);
g_unix_signal_add (SIGUSR1, term_signal_handler, NULL);

This stops it gracefully shutting down.

I have tested / Add SIGTERM/SIGINT/SIGUSR1 handlers / g_unix_signal_add (SIGTERM, term_signal_handler, NULL); g_unix_signal_add (SIGINT, term_signal_handler, NULL); g_unix_signal_add (SIGUSR1, usr1_signal_handler, NULL);

With a systemd service to start/stop the bt-agent and it works.

Cheers, Martin.

mroelandts commented 3 years ago

This is still not fixed??

sonicpp commented 3 years ago

Should be fixed by commit e30d58fcc9eb8b7c75e0c358d7046deb7e7cd1a6 I believe.

OrangeDog commented 2 years ago

The Debian packages are still at 7cb788c. Are any of the maintainers here? I don't really know the process for this sort of thing.