Use systemd user session instead of dbus user session 88/69188/1 accepted/tizen/common/20160512.150221 submit/tizen/20160512.072201
authorDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 12 May 2016 05:51:52 +0000 (14:51 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 12 May 2016 05:53:27 +0000 (14:53 +0900)
To use the user session daemon's privilege, we should use
systemd's user session. Do not use dbus auto-activation directly.

Change-Id: Idc98997d1e5a7c4883b8a5411c423680eba48e34
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
map-agent/CMakeLists.txt
map-agent/org.bluez.map_agent.service
packaging/bluetooth-agent.spec
packaging/bluetooth-map-agent.service [new file with mode: 0644]

index 78c6722..e58e60e 100644 (file)
@@ -20,5 +20,4 @@ ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_map_agent_LDFLAGS})
 
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.bluez.map_agent.service
-               DESTINATION share/dbus-1/services)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.bluez.map_agent.service DESTINATION share/dbus-1/services)
index bee56cc..27d11b8 100644 (file)
@@ -1,5 +1,4 @@
 [D-BUS Service]
 Name=org.bluez.map_agent
-Exec=/usr/bin/bluetooth-map-agent
-User=network_fw
-Group=network_fw
+Exec=/usr/bin/false
+SystemdService=bluetooth-map-agent.service
index ad9a45b..1c5c6f2 100644 (file)
@@ -93,14 +93,14 @@ rm -rf %{buildroot}
 %make_install
 
 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-agent
-mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
+#mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
 #%if "%{?profile}" != "wearable"
 #install -m 0644 packaging/bluetooth-ag-agent.service %{buildroot}%{_unitdir}/
 #ln -s ../bluetooth-ag-agent.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-ag-agent.service
 #%endif
-%if 0%{?sec_product_feature_bt_map_server_enable}
+#%if 0%{?sec_product_feature_bt_map_server_enable}
 install -D -m 0644 packaging/bluetooth-map-agent.service %{buildroot}%{_libdir}/systemd/user/bluetooth-map-agent.service
-%endif
+#%endif
 
 
 %post
@@ -125,5 +125,6 @@ ln -sf %{_libdir}/systemd/user/bluetooth-map-agent.service %{_sysconfdir}/system
 #%{_usrlibdir}/systemd/system/multi-user.target.wants/bluetooth-ag-agent.service
 %attr(0666,-,-) /var/lib/bluetooth/voice-recognition-blacklist
 %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf
+%{_libdir}/systemd/user/bluetooth-map-agent.service
 %endif
 %{_datadir}/license/bluetooth-agent
diff --git a/packaging/bluetooth-map-agent.service b/packaging/bluetooth-map-agent.service
new file mode 100644 (file)
index 0000000..7237835
--- /dev/null
@@ -0,0 +1,7 @@
+[Unit]
+Description=Bluetooth MAP Agent
+
+[Service]
+Type=dbus
+BusName=org.bluez.map_agent
+ExecStart=/usr/bin/bluetooth-map-agent