From 0636a698a2990d994de1cd1fc4b85fa091d1dfdd Mon Sep 17 00:00:00 2001 From: Wootak Jung Date: Wed, 20 Jun 2018 09:38:30 +0900 Subject: [PATCH] Add bluetooth-share-start.service and path file Change-Id: I53e2ec5fbdb6e61b71a557fb28f971372d1f6e51 --- packaging/bluetooth-share-start.path | 5 +++++ packaging/bluetooth-share-start.service | 15 +++++++++++++++ packaging/bluetooth-share.spec | 11 ++++++++++- 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 packaging/bluetooth-share-start.path create mode 100644 packaging/bluetooth-share-start.service diff --git a/packaging/bluetooth-share-start.path b/packaging/bluetooth-share-start.path new file mode 100644 index 0000000..5a3eefb --- /dev/null +++ b/packaging/bluetooth-share-start.path @@ -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 index 0000000..372836e --- /dev/null +++ b/packaging/bluetooth-share-start.service @@ -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 diff --git a/packaging/bluetooth-share.spec b/packaging/bluetooth-share.spec index 744c1d2..f39cedc 100644 --- a/packaging/bluetooth-share.spec +++ b/packaging/bluetooth-share.spec @@ -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 -- 2.7.4