Add bluetooth-share-start.service and path file 13/182013/1 accepted/tizen/unified/20180621.141258 submit/tizen/20180620.021117
authorWootak Jung <wootak.jung@samsung.com>
Wed, 20 Jun 2018 00:38:30 +0000 (09:38 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Wed, 20 Jun 2018 00:38:30 +0000 (09:38 +0900)
Change-Id: I53e2ec5fbdb6e61b71a557fb28f971372d1f6e51

packaging/bluetooth-share-start.path [new file with mode: 0644]
packaging/bluetooth-share-start.service [new file with mode: 0644]
packaging/bluetooth-share.spec

diff --git a/packaging/bluetooth-share-start.path b/packaging/bluetooth-share-start.path
new file mode 100644 (file)
index 0000000..5a3eefb
--- /dev/null
@@ -0,0 +1,5 @@
+[Unit]
+Description=Path activation for the "bluetooth-share-start"
+
+[Path]
+PathExists=/run/.bluetooth_share_start
diff --git a/packaging/bluetooth-share-start.service b/packaging/bluetooth-share-start.service
new file mode 100644 (file)
index 0000000..372836e
--- /dev/null
@@ -0,0 +1,15 @@
+[Unit]
+Description=Service to run bluetooth-share normally
+
+[Service]
+User=network_fw
+Group=network_fw
+Type=oneshot
+SmackProcessLabel=System
+SupplementaryGroups=priv_mediastorage priv_externalstorage
+ExecStartPre=/usr/bin/rm -f /run/.bluetooth_share_start
+ExecStart=/usr/bin/bluetooth-share
+RemainAfterExit=no
+SuccessExitStatus=1
+StartLimitInterval=1
+StartLimitBurst=10
index 744c1d23bab794d314375e47a5eedf74c000eac2..f39cedc72dc0e574e12364564f24bd73ce9f5c04 100644 (file)
@@ -96,6 +96,8 @@ make
 
 install -D -m 0755 %{SOURCE1004} %{buildroot}%{TZ_COMM_DATA}/%{name}/init_db.sh
 install -D -m 0644 packaging/bluetooth-share.service %{buildroot}%{_libdir}/systemd/system/bluetooth-share.service
+install -D -m 0644 packaging/bluetooth-share-start.service %{buildroot}%{_libdir}/systemd/system/bluetooth-share-start.service
+install -D -m 0644 packaging/bluetooth-share-start.path %{buildroot}%{_libdir}/systemd/system/bluetooth-share-start.path
 
 mkdir -p %{buildroot}%{upgrade_script_path}
 mkdir -p %{buildroot}%{upgrade_data_path}
@@ -105,7 +107,12 @@ cp -f packaging/init_db.sh %{buildroot}%{upgrade_data_path}
 %post
 /sbin/ldconfig
 %{TZ_COMM_DATA}/%{name}/init_db.sh
+mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+mkdir -p %{_libdir}/systemd/system/multi-user.target.wants/
 ln -sf %{_libdir}/systemd/system/bluetooth-share.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+ln -sf %{_libdir}/systemd/system/bluetooth-share-start.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+ln -sf %{_libdir}/systemd/system/bluetooth-share-start.path %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+ln -sf %{_libdir}/systemd/system/bluetooth-share-start.path %{_sysconfdir}/systemd/system/multi-user.target.wants/
 
 %post -n libbluetooth-share-devel -p /sbin/ldconfig
 
@@ -123,6 +130,8 @@ ln -sf %{_libdir}/systemd/system/bluetooth-share.service %{_sysconfdir}/systemd/
 #%{_datadir}/dbus-1/system-services/org.bluetooth.share.service
 %{TZ_COMM_DATA}/%{name}/init_db.sh
 %{_libdir}/systemd/system/bluetooth-share.service
+%{_libdir}/systemd/system/bluetooth-share-start.service
+%{_libdir}/systemd/system/bluetooth-share-start.path
 %{upgrade_script_path}/500.bluetooth-share_upgrade.sh
 %{upgrade_data_path}/init_db.sh
 
@@ -146,4 +155,4 @@ ln -sf %{_libdir}/systemd/system/bluetooth-share.service %{_sysconfdir}/systemd/
 %{_libdir}/libbt-share.so*
 %exclude %{_libdir}/debug/*
 %exclude %{_libdir}/debug/.build-id/*
-%endif
\ No newline at end of file
+%endif