Message ID | 20250423163343.4160595-1-kernel.org@pileofstuff.org |
---|---|
Headers | show |
Series | obex: unregster profiles when the user is inactive | expand |
Hello: This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>: On Wed, 23 Apr 2025 17:33:22 +0100 you wrote: > This is a follow-up to "obexd: only run one instance at once". > Instead of refusing to run parallel services, it unregisters > profiles when the user is inactive. This avoids the need > for tmpfiles, and avoids issues where the user with the > obex service logs out, leaving obex disabled altogether. > > Luiz previously suggested moving this to systemd, but I haven't had much > luck getting the systemd devs to accept changes, and Pauli's mention of > elogind (i.e. logind without systemd) suggests it's probably better > to avoid the dependency anyway. > > [...] Here is the summary with links: - [BlueZ,1/4] pbap: Support calling pbap_init() after pbap_exit() (no matching commit) - [BlueZ,2/4] obexd/bluetooth: Support calling bluetooth_init() after bluetooth_exit() (no matching commit) - [BlueZ,3/4] obex: unregster profiles when the user is inactive (no matching commit) - [BlueZ,4/4] Revert "obexd: only run one instance at once" https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=f8d0dc114036 You are awesome, thank you!
This is a follow-up to "obexd: only run one instance at once". Instead of refusing to run parallel services, it unregisters profiles when the user is inactive. This avoids the need for tmpfiles, and avoids issues where the user with the obex service logs out, leaving obex disabled altogether. Luiz previously suggested moving this to systemd, but I haven't had much luck getting the systemd devs to accept changes, and Pauli's mention of elogind (i.e. logind without systemd) suggests it's probably better to avoid the dependency anyway. I considered writing a separate D-Bus service that would notify you when the session became (in)active, but D-Bus doesn't have particularly strong guarantees about how long messages take to deliver, which could lead to race conditions between instances on overloaded systems. I also considered writing some kind of library, but there's not much code to deduplicate, and most of it would need to be reworked for every service that uses it. So I wrote a gist for people to copy/paste: https://gist.github.com/andrew-sayers/1c4a24f86a9a4c1b1e38d109f1bd1d1e Signed-off-by: Andrew Sayers <kernel.org@pileofstuff.org> --- Andrew Sayers (4): pbap: Support calling pbap_init() after pbap_exit() obexd/bluetooth: Support calling bluetooth_init() after bluetooth_exit() obex: unregster profiles when the user is inactive Revert "obexd: only run one instance at once" Makefile.obexd | 10 ++ obexd/client/pbap.c | 34 ++++++- obexd/plugins/bluetooth.c | 44 ++++++++- obexd/src/logind.c | 238 ++++++++++++++++++++++++++++++++++++++++++++++ obexd/src/logind.h | 26 +++++ obexd/src/main.c | 4 + obexd/src/obex.service.in | 9 -- 7 files changed, 350 insertions(+), 15 deletions(-)