Launch bluetooth-share process by systemd 68/76968/1 accepted/tizen/common/20160629.222418 accepted/tizen/ivi/20160629.020434 accepted/tizen/mobile/20160629.020507 accepted/tizen/tv/20160629.020445 accepted/tizen/wearable/20160629.020451 submit/tizen/20160628.064957
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 28 Jun 2016 06:47:54 +0000 (15:47 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 28 Jun 2016 06:47:54 +0000 (15:47 +0900)
Change-Id: Ifffe7446911a62b494371ca13f173c4c2dfc4e40
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-share/CMakeLists.txt
bt-share/include/bt-share-common.h
bt-share/src/org.bluetooth.share.service
packaging/bluetooth-share.service [new file with mode: 0644]
packaging/bluetooth-share.spec

index 590d1fb..a62e97e 100644 (file)
@@ -57,4 +57,4 @@ TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} ${CALENDAR_SERVICE2_LDFLAG
 
 
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/org.bluetooth.share.service DESTINATION share/dbus-1/system-services)
+#INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/org.bluetooth.share.service DESTINATION share/dbus-1/system-services)
index 74961d6..cc01ed6 100644 (file)
@@ -35,23 +35,23 @@ extern "C" {
 
 #define STORAGE_PATH_LEN_MAX 255
 
-#define BT_DOWNLOAD_DEFAULT_PHONE_FOLDER "/opt/home/owner/content/Downloads"
+#define BT_DOWNLOAD_DEFAULT_PHONE_FOLDER "/home/owner/content/Downloads"
 #define BT_DOWNLOAD_DEFAULT_MMC_FOLDER "/opt/media/SDCardA1"
-#define BT_DOWNLOAD_DEFAULT_MEDIA_FOLDER "/opt/home/owner/content/Downloads"
+#define BT_DOWNLOAD_DEFAULT_MEDIA_FOLDER "/home/owner/content/Downloads"
 //#define BT_DOWNLOAD_DEFAULT_MEDIA_FOLDER tzplatform_getenv(TZ_USER_CONTENT)
 
 /*
 #define BT_FTP_FOLDER tzplatform_mkpath(TZ_SYS_SHARE, "bt-ftp")
 */
 
-#define BT_DOWNLOAD_PHONE_ROOT "/opt/home/owner/content/"
+#define BT_DOWNLOAD_PHONE_ROOT "/home/owner/content/"
 #define BT_DOWNLOAD_MMC_ROOT "/opt/media/SDCardA1"
 #define BT_FTP_FOLDER "/opt/share/bt-ftp"
 #define BT_FTP_FOLDER_PHONE "/opt/share/bt-ftp/Media/"
 #define BT_FTP_FOLDER_MMC "/opt/share/bt-ftp/SD_External/"
 
 //#define BT_TMP_DIR "/opt/home/owner/content/Downloads/.bluetooth/"
-#define BT_TMP_DIR "/opt/home/owner/content/Downloads/"
+#define BT_TMP_DIR "/home/owner/content/Downloads/"
 #define BT_TMP_FILE BT_TMP_DIR"bluetooth_content_share"
 #define TXT_FILE_NAME BT_TMP_DIR"bluetooth_content_share.txt"
 #define HTML_FILE_NAME BT_TMP_DIR"bluetooth_content_share.html"
@@ -60,7 +60,7 @@ extern "C" {
 #define HTML_FORMAT "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\"/></head><body><a href=\"%s\">%s</a></body></html>"
 
 //#define BT_CONTACT_SHARE_TMP_DIR "/opt/home/owner/content/Downloads/.bluetooth/"
-#define BT_CONTACT_SHARE_TMP_DIR "/opt/home/owner/content/Downloads/"
+#define BT_CONTACT_SHARE_TMP_DIR "/home/owner/content/Downloads/"
 
 typedef enum {
        BT_HTTP_FILE,
index 66f26a1..600471b 100644 (file)
@@ -1,3 +1,4 @@
 [D-BUS Service]
 Name=org.bluetooth.share
-Exec=/usr/bin/bluetooth-share
+Exec=/bin/false
+SystemdService=bluetooth-share.service
diff --git a/packaging/bluetooth-share.service b/packaging/bluetooth-share.service
new file mode 100644 (file)
index 0000000..7f60913
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=Bluetooth service
+
+[Service]
+User=owner
+Group=users
+SupplementaryGroups=priv_mediastorage priv_externalstorage
+Type=simple
+ExecStart=/usr/bin/bluetooth-share
+KillMode=process
index 8f8f296..e3e5fcd 100644 (file)
@@ -82,10 +82,12 @@ make
 %make_install
 
 install -D -m 0755 %{SOURCE1004} %{buildroot}%{TZ_SYS_DATA}/%{name}/init_db.sh
+install -D -m 0644 packaging/bluetooth-share.service %{buildroot}%{_libdir}/systemd/system/bluetooth-share.service
 
 %post -n libbluetooth-share-devel -p /sbin/ldconfig
 
 %post -n libbluetooth-share -p /sbin/ldconfig
+ln -sf %{_libdir}/systemd/system/bluetooth-share.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
 
 %postun -n libbluetooth-share-devel -p /sbin/ldconfig
 
@@ -95,8 +97,9 @@ install -D -m 0755 %{SOURCE1004} %{buildroot}%{TZ_SYS_DATA}/%{name}/init_db.sh
 %manifest %{name}.manifest
 %defattr(-,root,root,-)
 %{_bindir}/bluetooth-share
-%{_datadir}/dbus-1/system-services/org.bluetooth.share.service
+#%{_datadir}/dbus-1/system-services/org.bluetooth.share.service
 %{TZ_SYS_DATA}/%{name}/init_db.sh
+%{_libdir}/systemd/system/bluetooth-share.service
 
 %files -n libbluetooth-share
 %manifest libbluetooth-share.manifest