Diff between 2a569ec80ffb4ea7a7dc1651b6befb51f2d34cd7 and 8d472b8758dcdd89bf13cf2fb06a8846e1f483a0

Changed Files

File Additions Deletions Status
obexd/src/obex.service.in +9 -0 modified

Full Patch

diff --git a/obexd/src/obex.service.in b/obexd/src/obex.service.in
index cf4d8c9..f269bc5 100644
--- a/obexd/src/obex.service.in
+++ b/obexd/src/obex.service.in
@@ -1,10 +1,19 @@
 [Unit]
 Description=Bluetooth OBEX service
+# This is a user-specific service, but bluetooth is a device-specific protocol.
+# Only run one instance at a time, even if multiple users log in at once:
+ConditionPathExists=!/run/lock/bluez/obexd.lock
+ConditionUser=!@system
 
 [Service]
 Type=dbus
 BusName=org.bluez.obex
 ExecStart=@PKGLIBEXECDIR@/obexd
 
+# If the service fails on the following line, please ensure
+# the bluez tmpfile has been installed in /usr/lib/tmpfiles.d/
+ExecStartPre=touch /run/lock/bluez/obexd.lock
+ExecStopPost=rm -f /run/lock/bluez/obexd.lock
+
 [Install]
 Alias=dbus-org.bluez.obex.service