From bb37f3e3e2dda1f679376088318eb8ab7c68bb24 Mon Sep 17 00:00:00 2001 From: DoHyun Pyun Date: Mon, 28 May 2018 13:39:17 +0900 Subject: [PATCH] Add the service files to run bt-stack-down*.sh via file activation Change-Id: I65c399178d41ecee0a47bf6e62c1deb37ffa3f24 Signed-off-by: DoHyun Pyun --- packaging/bluetooth-stack-down-with-radio.path | 5 +++++ packaging/bluetooth-stack-down-with-radio.service | 6 ++++++ packaging/bluetooth-stack-down.path | 5 +++++ packaging/bluetooth-stack-down.service | 6 ++++++ packaging/bluetooth-tools.spec | 9 +++++++++ 5 files changed, 31 insertions(+) create mode 100644 packaging/bluetooth-stack-down-with-radio.path create mode 100644 packaging/bluetooth-stack-down-with-radio.service create mode 100644 packaging/bluetooth-stack-down.path create mode 100644 packaging/bluetooth-stack-down.service diff --git a/packaging/bluetooth-stack-down-with-radio.path b/packaging/bluetooth-stack-down-with-radio.path new file mode 100644 index 0000000..b9a8603 --- /dev/null +++ b/packaging/bluetooth-stack-down-with-radio.path @@ -0,0 +1,5 @@ +[Unit] +Description=Path activation for the "bluetooth-stack-down-with-radio.service" + +[Path] +PathExists=/run/.bt_stack_down_with_radio \ No newline at end of file diff --git a/packaging/bluetooth-stack-down-with-radio.service b/packaging/bluetooth-stack-down-with-radio.service new file mode 100644 index 0000000..e163009 --- /dev/null +++ b/packaging/bluetooth-stack-down-with-radio.service @@ -0,0 +1,6 @@ +[Unit] +Description=Service to run bt-stack-down-with-radio.sh script to terminate BT functions + +[Service] +Type=oneshot +ExecStart=/usr/etc/bluetooth/bt-stack-down-with-radio.sh diff --git a/packaging/bluetooth-stack-down.path b/packaging/bluetooth-stack-down.path new file mode 100644 index 0000000..0e2c46f --- /dev/null +++ b/packaging/bluetooth-stack-down.path @@ -0,0 +1,5 @@ +[Unit] +Description=Path activation for the "bluetooth-stack-down.service" + +[Path] +PathExists=/run/.bt_stack_down \ No newline at end of file diff --git a/packaging/bluetooth-stack-down.service b/packaging/bluetooth-stack-down.service new file mode 100644 index 0000000..784a278 --- /dev/null +++ b/packaging/bluetooth-stack-down.service @@ -0,0 +1,6 @@ +[Unit] +Description=Service to run bt-stack-down.sh script to terminate BT functions + +[Service] +Type=oneshot +ExecStart=/usr/etc/bluetooth/bt-stack-down.sh diff --git a/packaging/bluetooth-tools.spec b/packaging/bluetooth-tools.spec index 8953f8e..79ccf1e 100644 --- a/packaging/bluetooth-tools.spec +++ b/packaging/bluetooth-tools.spec @@ -103,6 +103,9 @@ install -D -m 0644 packaging/bluez-start.path %{buildroot}%{_libdir}/systemd/sys 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 +install -D -m 0644 packaging/bluetooth-stack-down.service %{buildroot}%{_libdir}/systemd/system/bluetooth-stack-down.service +install -D -m 0644 packaging/bluetooth-stack-down.path %{buildroot}%{_libdir}/systemd/system/bluetooth-stack-down.path + install -D -m 0644 packaging/bluetooth-force-hci-logger.service %{buildroot}%{_libdir}/systemd/system/bluetooth-force-hci-logger.service install -D -m 0644 packaging/bluetooth-hci-dump@.service %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-dump@.service @@ -125,6 +128,10 @@ ln -sf %{_libdir}/systemd/system/bluetooth-share-start.service %{_sysconfdir}/sy ln -sf %{_libdir}/systemd/system/bluetooth-share-start.path %{_libdir}/systemd/system/multi-user.target.wants/bluetooth-share-start.path ln -sf %{_libdir}/systemd/system/bluetooth-share-start.path %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/ +ln -sf %{_libdir}/systemd/system/bluetooth-stack-down.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/ +ln -sf %{_libdir}/systemd/system/bluetooth-stack-down.path %{_libdir}/systemd/system/multi-user.target.wants/bluetooth-stack-down.path +ln -sf %{_libdir}/systemd/system/bluetooth-stack-down.path %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/ + ln -sf %{_libdir}/systemd/system/bluetooth-force-hci-logger.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/ @@ -153,6 +160,8 @@ ln -sf %{_libdir}/systemd/system/bluetooth-force-hci-logger.service %{_sysconfdi %{_libdir}/systemd/system/bluetooth-share-start.path %{_libdir}/systemd/system/bluetooth-force-hci-logger.service %{_libdir}/systemd/system/bluetooth-hci-dump@.service +%{_libdir}/systemd/system/bluetooth-stack-down.service +%{_libdir}/systemd/system/bluetooth-stack-down.path %post profile_common pushd %{_prefix}/etc/bluetooth/ -- 2.7.4