From 541ffe01dce3eeda762725fc8fcb948e6c225c4b Mon Sep 17 00:00:00 2001 From: DoHyun Pyun Date: Mon, 23 Sep 2019 10:02:56 +0900 Subject: [PATCH] Use the systemd service for the dbus auto-activation Change-Id: I06393b42ac5f8747183be776663c75dd8b4cf4fb Signed-off-by: DoHyun Pyun --- ag-agent/org.bluez.ag_agent.service | 4 ++-- hf-agent/org.bluez.hf_agent.service | 4 ++-- hid-agent/org.bluez.hid_agent.service | 4 ++-- packaging/bluetooth-ag-agent.service | 10 ++++++++++ packaging/bluetooth-agent.spec | 7 ++++++- packaging/bluetooth-hf-agent.service | 10 ++++++++++ packaging/bluetooth-hid-agent.service | 10 ++++++++++ 7 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 packaging/bluetooth-ag-agent.service create mode 100644 packaging/bluetooth-hf-agent.service create mode 100644 packaging/bluetooth-hid-agent.service diff --git a/ag-agent/org.bluez.ag_agent.service b/ag-agent/org.bluez.ag_agent.service index da7734f..a730d00 100644 --- a/ag-agent/org.bluez.ag_agent.service +++ b/ag-agent/org.bluez.ag_agent.service @@ -1,4 +1,4 @@ [D-BUS Service] Name=org.bluez.ag_agent -Exec=/usr/bin/bluetooth-ag-agent -User=network_fw +Exec=/bin/false +SystemdService=bluetooth-ag-agent.service diff --git a/hf-agent/org.bluez.hf_agent.service b/hf-agent/org.bluez.hf_agent.service index f63552c..67e2bdc 100644 --- a/hf-agent/org.bluez.hf_agent.service +++ b/hf-agent/org.bluez.hf_agent.service @@ -1,4 +1,4 @@ [D-BUS Service] Name=org.bluez.hf_agent -Exec=/usr/bin/bluetooth-hf-agent -User=root +Exec=/bin/false +SystemdService=bluetooth-hf-agent.service diff --git a/hid-agent/org.bluez.hid_agent.service b/hid-agent/org.bluez.hid_agent.service index 73b891c..03bc8ab 100644 --- a/hid-agent/org.bluez.hid_agent.service +++ b/hid-agent/org.bluez.hid_agent.service @@ -1,4 +1,4 @@ [D-BUS Service] Name=org.bluez.hid_agent -Exec=/usr/bin/bluetooth-hid-agent -User=network_fw +Exec=/bin/false +SystemdService=bluetooth-hid-agent.service diff --git a/packaging/bluetooth-ag-agent.service b/packaging/bluetooth-ag-agent.service new file mode 100644 index 0000000..99b3502 --- /dev/null +++ b/packaging/bluetooth-ag-agent.service @@ -0,0 +1,10 @@ +[Unit] +Description=Bluetooth AG Agent + +[Service] +User=network_fw +Group=network_fw +SmackProcessLabel=System +Type=dbus +BusName=org.bluez.ag_agent +ExecStart=/usr/bin/bluetooth-ag-agent diff --git a/packaging/bluetooth-agent.spec b/packaging/bluetooth-agent.spec index 56b3412..ef5fde1 100644 --- a/packaging/bluetooth-agent.spec +++ b/packaging/bluetooth-agent.spec @@ -152,7 +152,6 @@ make VERBOSE=1 rm -rf %{buildroot} %make_install -install -D -m 0644 packaging/bluetooth-map-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-map-agent.service # This usage of profile macro does NOT conflict 4.0 configurability. #%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" # Original: wearable, ivi. Added: common, "undefined" @@ -163,7 +162,11 @@ install -D -m 0644 packaging/bluetooth-map-agent.service %{buildroot}%{_libdir}/ #install -D -m 0644 %{buildroot}/usr/bin/bluetooth-hf-agent %{buildroot}%{_bindir}/ #install -D -m 0644 %{buildroot}/usr/bin/bluetooth-ipsp-agent %{buildroot}%{_bindir}/ #%endif +install -D -m 0644 packaging/bluetooth-map-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-map-agent.service install -D -m 0644 packaging/bluetooth-pbap-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-pbap-agent.service +install -D -m 0644 packaging/bluetooth-ag-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-ag-agent.service +install -D -m 0644 packaging/bluetooth-hf-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-hf-agent.service +install -D -m 0644 packaging/bluetooth-hid-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-hf-agent.service %files %manifest %{name}.manifest @@ -177,6 +180,7 @@ install -D -m 0644 packaging/bluetooth-pbap-agent.service %{buildroot}%{_libdir} %attr(0666,-,-) /var/lib/bluetooth/voice-recognition-blacklist %{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf +%{_libdir}/systemd/system/bluetooth-ag-agent.service #%exclude %{_libdir}/systemd/system/bluetooth-map-agent.service #%exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service @@ -186,6 +190,7 @@ install -D -m 0644 packaging/bluetooth-pbap-agent.service %{buildroot}%{_libdir} %{_bindir}/bluetooth-hf-agent %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service %{_sysconfdir}/dbus-1/system.d/bluetooth-hf-agent.conf +%{_libdir}/systemd/system/bluetooth-hf-agent.service #%exclude %{_libdir}/systemd/system/bluetooth-map-agent.service #%exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service diff --git a/packaging/bluetooth-hf-agent.service b/packaging/bluetooth-hf-agent.service new file mode 100644 index 0000000..db368b8 --- /dev/null +++ b/packaging/bluetooth-hf-agent.service @@ -0,0 +1,10 @@ +[Unit] +Description=Bluetooth HF Agent + +[Service] +User=network_fw +Group=network_fw +SmackProcessLabel=System +Type=dbus +BusName=org.bluez.hf_agent +ExecStart=/usr/bin/bluetooth-hf-agent diff --git a/packaging/bluetooth-hid-agent.service b/packaging/bluetooth-hid-agent.service new file mode 100644 index 0000000..eb52c68 --- /dev/null +++ b/packaging/bluetooth-hid-agent.service @@ -0,0 +1,10 @@ +[Unit] +Description=Bluetooth HID Agent + +[Service] +User=network_fw +Group=network_fw +SmackProcessLabel=System +Type=dbus +BusName=org.bluez.hid_agent +ExecStart=/usr/bin/bluetooth-hid-agent -- 2.7.4