Add the service file for bt-core 65/170565/1 accepted/tizen/unified/20180226.142340 submit/tizen/20180221.011521 submit/tizen/20180226.020205
authorHyuk Lee <hyuk0512.lee@samsung.com>
Wed, 21 Feb 2018 00:20:48 +0000 (09:20 +0900)
committerHyuk Lee <hyuk0512.lee@samsung.com>
Wed, 21 Feb 2018 00:20:48 +0000 (09:20 +0900)
Change-Id: I8d7af5e04ad558579a6b434bf7c8d68fccda584f
Signed-off-by: Hyuk Lee <hyuk0512.lee@samsung.com>
bt-core/CMakeLists.txt
bt-core/bluetooth-frwk-core.service [new file with mode: 0644]
bt-core/org.projectx.bt_core.service
packaging/bluetooth-frwk.spec

index fa24aa7..c6ac939 100644 (file)
@@ -58,5 +58,6 @@ INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt_core.service DESTINATION share/dbus-1/system-services)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-core.service DESTINATION /usr/lib/systemd/system)
 
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-core.conf DESTINATION /etc/dbus-1/system.d)
diff --git a/bt-core/bluetooth-frwk-core.service b/bt-core/bluetooth-frwk-core.service
new file mode 100644 (file)
index 0000000..a66ef52
--- /dev/null
@@ -0,0 +1,16 @@
+[Unit]
+Description=Bluetooth framework Core
+After=multi-user.target
+
+[Service]
+User=network_fw
+Group=network_fw
+SmackProcessLabel=System
+SupplementaryGroups=priv_mediastorage priv_externalstorage dialout
+Type=dbus
+BusName=org.projectx.bt_core
+ExecStart=/usr/bin/bt-core
+KillMode=process
+
+[Install]
+WantedBy=multi-user.target
index 451fab3..63e673b 100644 (file)
@@ -1,5 +1,5 @@
 [D-BUS Service]
 Name=org.projectx.bt_core
-Exec=/usr/bin/bt-core
-User=network_fw
-Group=network_fw
+Exec=/bin/false
+User=root
+SystemdService=bluetooth-frwk-core.service
index d94404f..b3b7c9c 100644 (file)
@@ -366,9 +366,19 @@ install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_unitdir}/blue
 # common
 install -m 0644 packaging/bluetooth-frwk-common.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.common
 
+# bt-core
+install -m 0644 bt-core/bluetooth-frwk-core.service %{buildroot}%{_unitdir}/bluetooth-frwk-core.service
+
+
 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/starter.target.wants/bluetooth-frwk.service
 
+%post core
+mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d
+ln -sf %{_libdir}/systemd/system/bluetooth-frwk-core.service %{_libdir}/systemd/system/multi-user.target.wants/bluetooth-frwk-core.service
+ln -sf %{_libdir}/systemd/system/bluetooth-frwk-core.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+
+
 %postun -p /sbin/ldconfig
 
 %post service
@@ -444,6 +454,7 @@ popd
 %manifest %{name}.manifest
 %license LICENSE
 %defattr(-, root, root)
+%{_unitdir}/bluetooth-frwk-core.service
 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
 %{_bindir}/bt-core
 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf