From a991952f50ddaa23cc87fd6def25105467d0725f Mon Sep 17 00:00:00 2001 From: Wootak Jung Date: Tue, 2 Feb 2021 08:29:51 +0900 Subject: [PATCH] Migrate bluez-start.service from tools Change-Id: Ib0ddea5514ebbd7c6853d6eec81810f04c37d800 Signed-off-by: Wootak Jung --- packaging/bluez.spec | 20 ++++---------------- src/bluetooth.service.in | 3 ++- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/packaging/bluez.spec b/packaging/bluez.spec index c68bcd6..1f91ec4 100755 --- a/packaging/bluez.spec +++ b/packaging/bluez.spec @@ -402,13 +402,6 @@ install -D -m 0644 mesh/mesh-main.conf %{buildroot}%{_sysconfdir}/bluetooth/mesh install -D -m 0755 tools/obexctl %{buildroot}%{_bindir}/obexctl -#test -#if "tv" -mkdir -p %{buildroot}%{_libpath}/systemd/system/multi-user.target.wants/ -ln -sf bluetooth.service %{buildroot}%{_libpath}/systemd/system/dbus-org.bluez.service -ln -sf ../bluetooth.service %{buildroot}%{_libpath}/systemd/system/multi-user.target.wants/bluetooth.service -#endif - install -D -m 0644 obexd/src/obex.service %{buildroot}%{_libpath}/systemd/system/ %post -n bluez-extension-bredr @@ -423,6 +416,9 @@ for FILE in bluetoothd.le; do mv "$FILE" "${FILE%.le}"; done popd /sbin/ldconfig +%post +ln -s %{_unitdir}/bluetooth.service %{_unitdir}/bluez-start.service + %files %manifest %{name}.manifest %defattr(-, root, root) @@ -454,6 +450,7 @@ popd #%{_sbindir}/hid2hci %dir /usr/lib/udev /usr/lib/udev/* +%{_unitdir}/bluetooth.service %files -n bluez-extension-bredr %manifest %{name}.manifest @@ -464,17 +461,11 @@ popd %manifest %{name}.manifest %defattr(-, root, root) %{_libexecdir}/bluetooth/bluetoothd.le - -#test -2 -%exclude /%{_libpath}/systemd/system/bluetooth.service -%exclude %{_libpath}/systemd/system/multi-user.target.wants/bluetooth.service -%exclude /%{_datadir}/dbus-1/system-services/org.bluez.service %config %{_sysconfdir}/dbus-1/system.d/bluetooth.conf %dir /var/lib/bluetooth %dir %{_sysconfdir}/modprobe.d %config(noreplace) %{_sysconfdir}/modprobe.d/50-bluetooth.conf - %files mesh %manifest %{name}.manifest %defattr(-, root, root) @@ -533,9 +524,6 @@ rm %{_sysconfdir}/bluetooth/main.conf %files profile_tv %manifest %{name}.manifest %{_sysconfdir}/bluetooth/main.conf -%exclude %{_libpath}/systemd/system/bluetooth.service -%exclude %{_libpath}/systemd/system/multi-user.target.wants/bluetooth.service -%exclude %{_libpath}/systemd/system/dbus-org.bluez.service %exclude %{_datadir}/dbus-1/system-services/org.bluez.service %files profile_common diff --git a/src/bluetooth.service.in b/src/bluetooth.service.in index 11de4cb..1034949 100755 --- a/src/bluetooth.service.in +++ b/src/bluetooth.service.in @@ -7,11 +7,12 @@ User=network_fw Group=network_fw Type=dbus BusName=org.bluez -ExecStart=@pkglibexecdir@/bluetoothd -d -C +ExecStart=/usr/libexec/bluetooth/bluetoothd -d -C Capabilities=cap_net_admin,cap_net_raw,cap_net_bind_service,cap_dac_override=i SecureBits=keep-caps SmackProcessLabel=System KillMode=process +NotifyAccess=main [Install] WantedBy=multi-user.target -- 2.7.4