From 8abb61d0e1f76b6680c794ac91d4a0c386854d98 Mon Sep 17 00:00:00 2001 From: Chengwei Yang Date: Thu, 17 Oct 2013 18:06:37 +0800 Subject: [PATCH] Fix .service and install it into dbus system service directory In Tizen 3.0, dbus will running with an unprivileged user 'dbus' and use an setuid servicehelper to activate system service, which should be installed into the system-service directory if it provides system wide service, and "User=" field is must to have to servicehelper. Bug: https://bugs.tizen.org/jira/browse/PTREL-124 Change-Id: I4e8a3f14b4c639ac01fb7631dbf39a8ca02b78e9 Signed-off-by: Chengwei Yang --- daemon/CMakeLists.txt | 2 +- daemon/org.tizen.NetNfcService.service | 1 + packaging/nfc-manager.spec | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 2e32b15..997ed12 100755 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -26,6 +26,6 @@ TARGET_LINK_LIBRARIES(${NFC_DAEMON} ${daemon_pkgs_LDFLAGS} pthread dl rt nfc-com INSTALL(TARGETS ${NFC_DAEMON} DESTINATION bin) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.tizen.NetNfcService.service DESTINATION share/dbus-1/services) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.tizen.NetNfcService.service DESTINATION share/dbus-1/system-services) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/nfc-manager.xml DESTINATION share/packages) INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/sounds DESTINATION share/nfc-manager-daemon) diff --git a/daemon/org.tizen.NetNfcService.service b/daemon/org.tizen.NetNfcService.service index a94b24f..ae98f33 100644 --- a/daemon/org.tizen.NetNfcService.service +++ b/daemon/org.tizen.NetNfcService.service @@ -1,3 +1,4 @@ [D-BUS Service] Name=org.tizen.NetNfcService Exec=/usr/bin/nfc-manager-daemon +User=root diff --git a/packaging/nfc-manager.spec b/packaging/nfc-manager.spec index 5e2a495..e8bc7fe 100755 --- a/packaging/nfc-manager.spec +++ b/packaging/nfc-manager.spec @@ -137,7 +137,7 @@ systemctl daemon-reload #%%{_bindir}/ndef-tool %{_libdir}/systemd/system/%{name}.service %{_libdir}/systemd/system/multi-user.target.wants/%{name}.service -%{_datadir}/dbus-1/services/org.tizen.NetNfcService.service +%{_datadir}/dbus-1/system-services/org.tizen.NetNfcService.service %{_datadir}/packages/%{name}.xml %{_datadir}/nfc-manager-daemon/sounds/* %attr(0775,-,5000) %dir /opt/usr/share/nfc_debug -- 2.7.4